home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SCLIB.ARJ / SCL131.DOC < prev    next >
Text File  |  1992-01-01  |  622KB  |  19,254 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                               SCL1 C - FUNCTION LIBRARY
  29.  
  30.                                      VERSION 3.1
  31.  
  32.                                    REFERENCE MANUAL
  33.  
  34.                            COPYRIGHT (C) 1989,1990,1991 BY:
  35.  
  36.                                 JOSE RODRIGUEZ ALVIRA
  37.                                          AND
  38.                                     JOSE R. LEBRON
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.                                   TABLE OF CONTENTS
  48.  
  49.           OVERVIEW  . . . . . . . . . . . . . . . . . . . . . . . . . .   1
  50.  
  51.           DISCLAIMER  . . . . . . . . . . . . . . . . . . . . . . . . .   1
  52.  
  53.           INSTALLING SCL1 . . . . . . . . . . . . . . . . . . . . . . .   2
  54.  
  55.           USING SCL1  . . . . . . . . . . . . . . . . . . . . . . . . .   2
  56.  
  57.           WHAT IS SSG . . . . . . . . . . . . . . . . . . . . . . . . .   3
  58.  
  59.           SCL1DEMO  . . . . . . . . . . . . . . . . . . . . . . . . . .   3
  60.  
  61.           ALPHABETICAL REFERENCE  . . . . . . . . . . . . . . . . . . .   5
  62.  
  63.           APPENDIX "A" - FILE RELATED FUNCTIONS  . . . . . . . . . . .  288
  64.  
  65.           APPENDIX "B" - MOUSE FUNCTIONS . . . . . . . . . . . . . . .  290
  66.  
  67.           APPENDIX "C" - SCREEN RELATED FUNCTIONS  . . . . . . . . . .  291
  68.  
  69.           APPENDIX "D" - SCL1 HEADER FILES . . . . . . . . . . . . . .  293
  70.  
  71.           APPENDIX "E" - DIALOG TYPE FUNCTIONS . . . . . . . . . . . .  294
  72.  
  73.           APPENDIX "F" - EXTENDED MEMORY MANAGEMENT FUNCTIONS  . . . .  304
  74.  
  75.           APPENDIX "G" - EXPANDED MEMORY MANAGEMENT FUNCTIONS  . . . .  306
  76.  
  77.           APPENDIX "H" - KEYBOARD MACROS . . . . . . . . . . . . . . .  307
  78.  
  79.           APPENDIX "I" - COMMON COMPILER AND LINKER ERRORS . . . . . .  308
  80.  
  81.           APPENDIX "J" - CHARACTER DEFINITION TABLES . . . . . . . . .  309
  82.  
  83.           REGISTRATION INFORMATION . . . . . . . . . . . . . . . . . .  311
  84.  
  85.           INDEX  . . . . . . . . . . . . . . . . . . . . . . . . . . .  312
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.                      SCL1 Version 3.1 - Reference Manual - Page i
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.           OVERVIEW
  108.  
  109.           The functions included in this package provide an enhancement to
  110.           the standard C-library functions. Extensive screen, mouse and
  111.           memory handling functions are provided that are not found in the
  112.           standard C library. Every effort has been made to exploit the PC
  113.           hardware to its maximum capacity, portability has not been a
  114.           primary goal. The library is designed to work with Microsoft and
  115.           Borland C Compilers. The Shareware version contains stand alone
  116.           small memory model libraries for both families of compilers.
  117.  
  118.           You do not need to understand the internal workings of the
  119.           functions in order to take full advantage of them, all you need
  120.           to know is how to call them and how to pass the required
  121.           parameters.
  122.  
  123.           SCL1 is distributed under the Shareware concept. Feel free to try
  124.           it, if you like and use the product please register your copy.
  125.           Upon registration you will receive the following:
  126.  
  127.                1.   The latest version of SCL1.
  128.  
  129.                2.   Library modules for the small, medium, compact, large
  130.                     and huge (Borland version only) memory models for the
  131.                     compiler of your choice.
  132.  
  133.                3.   SSG, a screen editor and program generator for use with
  134.                     SCL1. (see the included SSG Reference Manual)
  135.  
  136.                4.   You will be notified of all updates and revisions.
  137.  
  138.           Feel free to distribute the Shareware version of SCL1 for trial
  139.           use by others on a private non-commercial basis. The only
  140.           distribution conditions are: that the code must not be modified
  141.           or altered, and that no fee (except a nominal distribution cost)
  142.           may be charged.
  143.  
  144.           DISCLAIMER
  145.  
  146.           THE FUNCTIONS INCLUDED IN THIS PACKAGE ARE, TO THE BEST OF OUR
  147.           KNOWLEDGE, ORIGINAL OR USE STANDARD ACCEPTED ALGORITHMS. THIS
  148.           SOFTWARE AND MANUAL ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO
  149.           PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER
  150.           EXPRESSED OR IMPLIED. BECAUSE OF THE VARIOUS HARDWARE AND
  151.           SOFTWARE ENVIRONMENTS INTO WHICH THIS PROGRAM MAY BE PUT, NO
  152.           WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
  153.  
  154.           GOOD DATA PROCESSING PROCEDURE DICTATES THAT ANY PROGRAM BE
  155.           THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON IT.
  156.           THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAM. ANY
  157.           LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT
  158.           REPLACEMENT OR REFUND OF PURCHASE PRICE.
  159.  
  160.                      SCL1 Version 3.1 - Reference Manual - Page 1
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.           Feel free to send any comments or suggestions even if you do not
  169.           decide to register your copy. If you find any bugs please let us
  170.           know so that they can be traced and fixed. Please include with
  171.           your comments any relevant information, such as; hardware
  172.           configuration, description of the bug or problem and, if
  173.           possible, a section of the problem code. Currently we can only
  174.           support this program by mail or by Compuserve.
  175.  
  176.           INSTALLING SCL1
  177.  
  178.           The files required to install SCL1 are distributed in compressed
  179.           self-extracting files. You can use the INSTALL.EXE (not included
  180.           in the Shareware version) program to perform the installation or
  181.           you can manually decompress and copy them to the corresponding
  182.           drives or directories. Library files are named using the
  183.           following convention:
  184.  
  185.                                         MSCL1S.LIB
  186.                                         ^    ^
  187.                                         |    |
  188.                     Compiler  <---------+    +------> Memory Model
  189.  
  190.                     M = Microsoft                      S = Small
  191.                     T = Borland                        M = Medium
  192.                                                        C = Compact
  193.                                                        L = Large
  194.                                                        H = Huge
  195.  
  196.           If you are using Microsoft C or Quick C copy the library files
  197.           starting with M to the drive or directory where you have your
  198.           library files and the header file to the drive or directory where
  199.           you have your include files. If you are using one of the Borland
  200.           compilers copy the files starting with T instead.
  201.  
  202.           USING SCL1
  203.  
  204.           To use SCL1 make sure you include the preprocessor directive
  205.           "#include <SCL1.H>" in your source file. Several other header
  206.           files may be needed if you use key-related constants
  207.           (scl1keys.h), color definitions (scl1clor.h), expanded memory
  208.           (scl1ems.h) or extended memory (scl1xms.h). See Appendix "D" for
  209.           more information.
  210.  
  211.           You can compile your programs in two different ways:
  212.  
  213.                Compiling from then Command Line
  214.  
  215.                Be sure to specify the correct library model in the command-
  216.                line. Check your compiler reference for more information.
  217.                Typical command-lines can be:
  218.  
  219.  
  220.  
  221.                      SCL1 Version 3.1 - Reference Manual - Page 2
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.                     cl source.c mscl1s.lib - Microsoft C
  230.  
  231.                     qcl source.c mscl1s.lib - Microsoft Quick-C
  232.  
  233.                     tcc source.c tscl1s.lib - Borland Turbo-C
  234.  
  235.                Using the Microsoft's QuickC Integrated Programming
  236.                Environment
  237.  
  238.                Create a program list were all your source files and the
  239.                LIBRARY NAME and PATH is specified. Read your compiler
  240.                documentation for more information.
  241.  
  242.                If you are using the BorlandC or TurboC Integrated
  243.                Programming Environment
  244.  
  245.                Create a Project File were all your source files and the
  246.                LIBRARY NAME. Project files are different in the TurboC and
  247.                BorlandC environments. Be sure to check your compiler's
  248.                reference manual.
  249.  
  250.           In all cases make sure that the SCL1 library is specified and
  251.           that the library's memory model matches the memory model
  252.           specified to the compiler. See Appendix "I" for more information
  253.           about possible errors.
  254.  
  255.           WHAT IS SSG
  256.  
  257.           You can really take the most advantage of SCL1 with an auxiliary
  258.           program called SSG. SSG is a full featured screen editor and
  259.           program generator that provides the tools for building program
  260.           screens, menus, dialog screens, data entry screens, etc. After
  261.           you design your screen, you instruct SSG about the desired
  262.           operations you want to perform, such as: saving the screen
  263.           contents, making a window, clearing all or part of the screen,
  264.           making a menu, etc. Then SSG will write the C code for the
  265.           desired operations using the functions available in SCL1. You can
  266.           merge the generated code into your program. SSG will help you in
  267.           speeding the most time consuming tasks during programming. The
  268.           SSG documentation is included in the Shareware version of SCL1.
  269.           Upon registration you will receive a full working copy of SSG.
  270.           The SCL1DEMO program shows some of SSG's capabilities.
  271.  
  272.           SCL1DEMO
  273.  
  274.           The program SCL1DEMO demonstrates some of the functions
  275.           available. It was written using SCL1 with the help of SSG. The
  276.           best way to discover about SCL1's features is to run this demo.
  277.           To start the demo type SCL1DEMO at the DOS prompt.  The source
  278.           code is sent with the registered version of SCL1 or you can
  279.           obtain it from TECH-BBS, see the registration information at the
  280.           end of this manual.
  281.  
  282.                      SCL1 Version 3.1 - Reference Manual - Page 3
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.           FUNCTION REFERENCE
  291.  
  292.           A uniform format has been used in the function reference.
  293.           Functions that are related have been described together. At the
  294.           top right corner of each page, the name of the function or
  295.           functions discussed in that page are shown to let you quickly
  296.           locate them. An index is provided at the end of the reference
  297.           section. The format used is as follows:
  298.  
  299.           -----------------------------------------------------------------
  300.                                     Function Name
  301.           -----------------------------------------------------------------
  302.  
  303.           Purpose:    A description of what the function does.
  304.  
  305.           Prototype:  Function prototype. The parameters types are shown. 
  306.                       All the function prototypes have been included in the
  307.                       header file SCL1.H so it is not necessary to declare
  308.                       them in your programs.
  309.  
  310.           Returns:    What the function returns.
  311.  
  312.           Parameters: A description of the parameters, structures, arrays,
  313.                       buffers, etc. required by the function are explained.
  314.  
  315.           Messages:   In the dialog type functions, messages are exchanged
  316.                       with the function.  This section describe these
  317.                       messages.
  318.  
  319.           Example:    An example that will further explain the function
  320.                       usage. Certain functions are self explanatory and do
  321.                       not require an example. File SCL1SAMP.EXE contains
  322.                       the source code for most examples. This file is
  323.                       included in the reagistered version of SCL1 and can
  324.                       be downloaded from Tech BBS.
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.                      SCL1 Version 3.1 - Reference Manual - Page 4
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.                                 ALPHABETICAL REFERENCE
  352.           -----------------------------------------------------------------
  353.                             AddExtension, ChangeExtension
  354.           -----------------------------------------------------------------
  355.  
  356.           Purpose:    AddExtension adds an extension to a filename if it
  357.                       has no extension and does not end with a period.
  358.                       ChangeExtension changes a filename's extension or
  359.                       adds an extension if it has none.
  360.  
  361.           Prototype:  char *AddExtension(char *Filename, char *Extension);
  362.  
  363.                       char *ChangeExtension(char *Filename,
  364.                          char *Extension);
  365.  
  366.           Returns:    a pointer to the filename buffer.
  367.  
  368.           Parameters:
  369.  
  370.               Filename - char pointer to filename.
  371.  
  372.               Extension - char pointer to string holding the extension.
  373.  
  374.           Example:
  375.  
  376.           #include <scl1.h>
  377.  
  378.           char Filename[13]="FILE";
  379.  
  380.           main()
  381.           {
  382.           printf("%s\n",Filename);
  383.  
  384.           /* Add an extension to file */
  385.           printf("%s\n",AddExtension(Filename,"C"));
  386.  
  387.           /* Change extension from "TXT" to "BAK"*/
  388.           ChangeExtension(Filename,"BAK");
  389.  
  390.           printf("%s\n",Filename);
  391.           }
  392.  
  393.           See also RemoveExtension
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.                      SCL1 Version 3.1 - Reference Manual - Page 5
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.                                                               BackgroundOff
  413.           -----------------------------------------------------------------
  414.                                     BackgroundOff
  415.           -----------------------------------------------------------------
  416.  
  417.           Purpose:    Stops a function running in the background.
  418.  
  419.           Prototype:  void BackgroundOff(void);
  420.  
  421.           Returns:    Nothing
  422.  
  423.           Parameters: None
  424.  
  425.           Example:
  426.  
  427.           #include <process.h>
  428.           #include <stdlib.h>
  429.           #include <errno.h>
  430.           #include <scl1.h>
  431.           #include <scl1clor.h>
  432.  
  433.           /*  BackgroundOn/Off example. Displays a clock in top right
  434.               corner of the screen */
  435.  
  436.           int hours,minutes,seconds;
  437.           char buffer[12];
  438.  
  439.           int BackClock(void);
  440.  
  441.           main()
  442.           {
  443.           char *p;
  444.  
  445.           Cls(WHITE_BLACK,CLS_ALL);
  446.  
  447.           GetTime();
  448.           hours=GT_Hours;
  449.           minutes=GT_Minutes;
  450.           seconds=GT_Seconds;
  451.  
  452.           SetCurPos(2,0);
  453.           printf("A background clock will be active until you type
  454.                   EXIT\n");
  455.  
  456.           BackgroundOn(BackClock);   /* set background function */
  457.  
  458.           p=getenv("COMSPEC");
  459.  
  460.               /* run command.com */
  461.  
  462.  
  463.  
  464.  
  465.                      SCL1 Version 3.1 - Reference Manual - Page 6
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.                                                               BackgroundOff
  474.  
  475.           if(p)
  476.             {
  477.             if(spawnl(P_WAIT,p,0))
  478.               {
  479.               if(errno == ENOMEM)
  480.                 printf("\nNot enough memory to load COMMAND.COM\n");
  481.               else
  482.                 printf("\nUnable to load COMMAND.COM\n");
  483.               }
  484.             }
  485.           else
  486.             printf("\nEnvironment Variable COMPSEC not found\n");
  487.  
  488.           BackgroundOff();  /* stop background process */
  489.  
  490.           ClearKeyBuf();
  491.           }
  492.  
  493.           #pragma check_stack(off)
  494.  
  495.               /* this function will be called 18.2 per second */
  496.  
  497.           int BackClock(void)
  498.           {
  499.           int i;
  500.           static int count=18;
  501.  
  502.               /*  count variable is used to keep track of time. When count=
  503.                   18, a second has elapsed  */
  504.  
  505.           if(count==18)
  506.             {
  507.             ++seconds;
  508.             if(seconds == 60)
  509.               {
  510.               seconds=0;
  511.               ++minutes;
  512.               if(minutes == 60)
  513.                 {
  514.                 minutes=0;
  515.                 ++hours;
  516.                 if(hours == 24)
  517.                 hours=0;
  518.                 }
  519.               }
  520.  
  521.             i=0;
  522.  
  523.  
  524.  
  525.  
  526.                      SCL1 Version 3.1 - Reference Manual - Page 7
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.                                                               BackgroundOff
  535.  
  536.               /* convert hours/minutes/seconds values to ASCII */
  537.  
  538.             if(hours < 10)
  539.                {
  540.                buffer[i]='0';
  541.                ++i;
  542.                }
  543.  
  544.             itoa(hours,buffer+i,10);
  545.  
  546.             i=3;
  547.  
  548.             if(minutes < 10)
  549.               {
  550.               buffer[i]='0';
  551.               ++i;
  552.               }
  553.  
  554.             itoa(minutes,buffer+i,10);
  555.  
  556.             i=6;
  557.             if(seconds < 10)
  558.               {
  559.               buffer[i]='0';
  560.               ++i;
  561.               }
  562.  
  563.             itoa(seconds,buffer+i,10);
  564.  
  565.             buffer[2]=':';
  566.             buffer[5]=':';
  567.             count=0;
  568.             }
  569.  
  570.           else
  571.             ++count;
  572.  
  573.           Box(BLACK_WHITE,0,0,69,2,78);
  574.           WriteScreen(BLACK_WHITE,70,buffer);
  575.           }
  576.  
  577.           Note:   It is very important to stop any background function
  578.                   before returning to DOS. Failure to do so can result in a
  579.                   system crash.
  580.  
  581.           See also BackgroundOn.
  582.  
  583.  
  584.  
  585.  
  586.  
  587.                      SCL1 Version 3.1 - Reference Manual - Page 8
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.                                             BackgroundOn - Beep - BigCursor
  596.           -----------------------------------------------------------------
  597.                                      BackgroundOn
  598.           -----------------------------------------------------------------
  599.  
  600.           Purpose:    Makes a function share microprocessor time with a
  601.                       main process (run in the background).
  602.  
  603.           Prototype:  void BackgroundOn(int (*FAddress)());
  604.  
  605.           Returns:    Nothing
  606.  
  607.           Parameter:  FAddress - Pointer to the function that will be set
  608.                       to run in the background.
  609.  
  610.           Example:    See BackgroundOff
  611.  
  612.           Note: Functions that run in the background must not perform disk
  613.           or keyboard input/output or call any time or sound related
  614.           function. SCL1's screen related functions (except GSSBox) and the
  615.           standard library data manipulation functions are generally safe
  616.           for use in background mode. Background functions are called 18.2
  617.           per second. Each time they are called they should do as little as
  618.           possible and return control to the calling routine. With a
  619.           Microsoft compiler you might need to disable the compiler's stack
  620.           checking option using the "#pragma check_stack(off)" directive.
  621.  
  622.           -----------------------------------------------------------------
  623.                                          Beep
  624.           -----------------------------------------------------------------
  625.  
  626.           Purpose:    Sends a beep tone to the console speaker.
  627.  
  628.           Prototype:  void Beep(void);
  629.  
  630.           Returns:    Nothing
  631.  
  632.           Parameters: None
  633.  
  634.           See also SoundOn, SoundOff and TSound
  635.  
  636.           -----------------------------------------------------------------
  637.                                       BigCursor
  638.           -----------------------------------------------------------------
  639.  
  640.           Purpose:    Changes the cursor size to a block.
  641.  
  642.           Prototype:  void BigCursor(void);
  643.  
  644.           Returns:    Nothing
  645.  
  646.           Parameters: None
  647.  
  648.                      SCL1 Version 3.1 - Reference Manual - Page 9
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.                                                                   Bin2Ascii
  657.           -----------------------------------------------------------------
  658.                                       Bin2Ascii
  659.           -----------------------------------------------------------------
  660.  
  661.           Purpose:    Fills a buffer with the ASCII code of a long integer
  662.                       value, adding commas, (i.e. 12,345). The buffer must
  663.                       be big enough to hold all characters plus commas and
  664.                       a null string terminating character.
  665.  
  666.           Prototype:  char *Bin2Ascii(long Number,char * Buffer);
  667.  
  668.           Returns:    a pointer to the buffer.
  669.  
  670.           Parameters:
  671.  
  672.               Number - number whose ASCII value is to be written into the
  673.               buffer (long integer).
  674.  
  675.               Buffer - char pointer to the buffer to hold the ASCII string.
  676.  
  677.           Example:
  678.  
  679.           #include <scl1.h>
  680.  
  681.           #define WIDTH 7
  682.  
  683.           main()
  684.           {
  685.           long l;
  686.           char buffer[8];
  687.           int i;
  688.  
  689.           l=999999;
  690.           Cls(7,CLS_ALL);
  691.           for(i=0;i < 6;++i,l/=10)
  692.             {
  693.             WriteScreenLen(7,10,10,WIDTH,Bin2Ascii(l,buffer));
  694.             GetKey();
  695.             }
  696.           }
  697.           See also SetBin2AsciiDel
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.                     SCL1 Version 3.1 - Reference Manual - Page 10
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.                                                                Box - GSSBox
  718.           -----------------------------------------------------------------
  719.                                      Box, GSSBox
  720.           -----------------------------------------------------------------
  721.  
  722.           Purpose:    Draws a box with one of 12 predefined types of
  723.                       frames. The row and column coordinates, color and
  724.                       frame type are specified. The minimum box size is 2
  725.                       rows and 2 columns. It does not perform bound
  726.                       checking, the box will spill out of the screen area
  727.                       if the coordinates are outside the screen range. It
  728.                       draws only the box's frame and does not fill the
  729.                       box's interior.
  730.  
  731.                       GSSBox draws a box frame and fills its interior.
  732.                       Three flags; Grow, Noise and Shadow can be specified.
  733.                       The grow flag tells the function to draw the box with
  734.                       a growing effect, the noise flag to make a swirling
  735.                       noise when drawing the box, and the shadow flag to
  736.                       add a shadow effect. If you do not specify a shadow
  737.                       color (using the SetShadowColor function) it will be
  738.                       XOR'ed to the current background color.  Leave space
  739.                       for the shadow characters. You can define other types
  740.                       of frames using SetUserBox.
  741.  
  742.           Prototype:  void Box(int Color,int FrameType,int UpperRow,
  743.                          int LeftCol,int LowerRow, int RightCol);
  744.  
  745.                       void GSSBox(int Color,int FrameType,int UpperRow,
  746.                          int LeftCol,int LowerRow,int RightCol,int GrowFl,
  747.                          int SoundFl,int ShadowFl);
  748.  
  749.           Returns:    Nothing
  750.  
  751.           Parameters:
  752.  
  753.               Color - color attribute for the box (integer).
  754.  
  755.               FrameType - frame type, an integer value from 0 to 11 as
  756.               follows, box frame 12 selects a user defined frame:
  757.  
  758.                ╔═════════╗ ┌─────────┐ ╓─────────╖ ╒═════════╕  ╒════════╕
  759.                ║ FRAME 0 ║ │ FRAME 1 │ ║ FRAME 2 ║ │ FRAME 3 │  │ FRAME 4│
  760.                ╚═════════╝ └─────────┘ ╙─────────╜ ╘═════════╛  └────────┘
  761.  
  762.                            ▄▄▄▄▄▄▄▄▄▄  ░░░░░░░░░░░  ▒▒▒▒▒▒▒▒▒▒  ▓▓▓▓▓▓▓▓▓▓
  763.                  FRAME 5   ▌ FRAME 6▐  ░ FRAME 7 ░  ▒FRAME 8 ▒  ▓FRAME 9 ▓
  764.                            ▀▀▀▀▀▀▀▀▀▀  ░░░░░░░░░░░  ▒▒▒▒▒▒▒▒▒▒  ▓▓▓▓▓▓▓▓▓▓
  765.  
  766.                ██████████  **********
  767.                █FRAME 10█  *FRAME 11*
  768.                ██████████  **********
  769.  
  770.                     SCL1 Version 3.1 - Reference Manual - Page 11
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.                                                                Box - GSSBox
  779.  
  780.               UpperRow - upper row position of the box (integer).
  781.  
  782.               LeftCol - left column position of the box (integer).
  783.  
  784.               LowerRow - lower row position of the box (integer).
  785.  
  786.               RightCol - right column position of the box (integer).
  787.  
  788.           (Note: the home position is row 0, column 0.)
  789.  
  790.           For GSSBox only:
  791.  
  792.               GrowFl - flag to indicate a growing effect. If this value is
  793.               "1" the box will grow from its center out. If the value is
  794.               "0" the box will pop into the screen (integer).
  795.  
  796.               SoundFl - flag to indicate a noise effect. If the value is
  797.               "1" when the box grows it will make a swirling noise. A value
  798.               of "0" will draw a quiet box (integer).
  799.  
  800.               ShadowFl - flag to indicate a shadow effect. If the value is
  801.               "1" a shadow effect will be drawn, if the value is "0" no
  802.               shadow effect will be drawn. The shadow will be XOR'ed to the
  803.               background, if no shadow color have been defined (integer).
  804.  
  805.           Example:
  806.  
  807.           #include <scl1.h>
  808.           #include <scl1clor.h>
  809.  
  810.           int Color1=WHITE_BLACK;
  811.  
  812.           main()
  813.           {
  814.           Box(Color1,6,2,18,16,67);
  815.           /*  Draws a box starting in line 2, column 16 and ending in line
  816.               18, column 67 with a small solid border.*/
  817.  
  818.           GSSBox(Color1,0,3,12,20,68,1,1,0);
  819.           /*  Will draw a growing, shadowed, double framed box between rows
  820.               3 & 20 and columns 12 & 68 */
  821.           }
  822.  
  823.           See also Shadow and SetShadowColor
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.                     SCL1 Version 3.1 - Reference Manual - Page 12
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.                                                        Buf2Disk - HBuf2Disk
  840.           -----------------------------------------------------------------
  841.                                  Buf2Disk, HBuf2Disk
  842.           -----------------------------------------------------------------
  843.  
  844.           Purpose:    Saves a buffer to disk. With HBuf2Disk the file size
  845.                       can be larger than 64K, using the compact and large
  846.                       models. HBuf2Disk's prototype is declared in
  847.                       SCL1HUGE.H
  848.  
  849.           Prototype:  int Buf2Disk(char* Filename, char *Buffer,
  850.                          unsigned int Bytes);
  851.  
  852.                       int HBuf2Disk(char* Filename,char huge *Buffer,
  853.                          unsigned long Bytes);
  854.  
  855.           Returns:    The DOS error code or "0" if no error occurs. (See
  856.                       Appendix "A", FILE FUNCTIONS, for more information).
  857.  
  858.           Parameters:
  859.  
  860.               Filename - filename of file to write data to (char pointer).
  861.  
  862.               Buffer - buffer that holds the data to be written to disk.
  863.  
  864.               Bytes - the number of bytes to write (unsigned integer for
  865.               Buf2Disk and unsigned long for HBuf2Disk).
  866.  
  867.           Example:
  868.  
  869.           #include <scl1.h>
  870.           char buffer[]="We'll write this data to disk and read it
  871.               back.\n";
  872.  
  873.           main()
  874.           {
  875.           int Error;
  876.           unsigned int size;
  877.  
  878.           if(Error=Buf2Disk("FILE.1",buffer,sizeof(buffer)))
  879.               {
  880.               printf("Error writing file # %i\n",Error);
  881.               exit(-1);
  882.               }
  883.           size=sizeof(buffer);
  884.           memset(buffer,0,size);
  885.           if(Error=File2Buf("FILE.1",buffer,&size))
  886.               printf("Error reading file # %i\n",Error);
  887.           else
  888.               printf("%s\n",buffer);
  889.           }
  890.           See also File2Buf, HFile2Buf and TrapInt24.
  891.  
  892.                     SCL1 Version 3.1 - Reference Manual - Page 13
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.                                                                    Calendar
  901.           -----------------------------------------------------------------
  902.                                        Calendar
  903.           -----------------------------------------------------------------
  904.  
  905.           Purpose:    Displays a calendar. It can display it either in
  906.                       english, spanish or in  any other language set by
  907.                       using the C_SetUserLang function. The calendar
  908.                       position can be set anywhere in the screen. No bounds
  909.                       checking is made.
  910.  
  911.           Prototype:  int Calendar(Message, CData *cd);
  912.  
  913.           Returns:    This is a dialog type function. See Appendix "E" for
  914.                       a description of the general operation of these
  915.                       functions. It returns messages as described below.
  916.  
  917.           Parameters: Dialog type functions receive messages and structures
  918.                       as parameters. The calendar information is defined in
  919.                       structure CData as follows:
  920.  
  921.           typedef struct{
  922.               int NColor;               Normal color for the calendar
  923.                                         display.
  924.  
  925.               int RColor;               Color for displaying the selected
  926.                                         day.
  927.  
  928.               int Row;                  Upper left row position of the
  929.                                         calendar.
  930.  
  931.               int Col;                  Upper left column position of the
  932.                                         calendar.
  933.  
  934.               int FrameType;            Type of frame to be used, any of
  935.                                         the frame types that can be used
  936.                                         with Box.
  937.  
  938.               unsigned int *ExitKeys;   Null-terminated array of keys that
  939.                                         will exit the calendar function.
  940.  
  941.               int Lang;                 Language. "0" for english, "1" for
  942.                                         spanish, "2" for any other language
  943.                                         (define the text with
  944.                                         C_SetUserLang).
  945.  
  946.               int Month;                Month to be displayed.
  947.  
  948.               int Day;                  Day to be displayed (1-31).
  949.  
  950.               int Year;                 Year to be displayed from 1900 to
  951.                                         2067.
  952.  
  953.                     SCL1 Version 3.1 - Reference Manual - Page 14
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.                                                                    Calendar
  962.  
  963.               unsigned int EventInfo;   Variable that holds the key pressed
  964.                                         when you exit the function or a
  965.                                         when a non defined key is pressed.
  966.               }CData;
  967.  
  968.           Messages:
  969.  
  970.           The following messages can be sent to Calendar:
  971.  
  972.               C_INIT - initialize the CData structure to NULL and set the
  973.               following default values:
  974.  
  975.                   NColor - white characters in a black background or the
  976.                   normal color set by SetDialogColors.
  977.  
  978.                   HColor - highlighted white characters in a black
  979.                   background or the highlight color set by SetDialogColors.
  980.  
  981.                   Col and Row - for display it in the middle of the screen.
  982.  
  983.                   Month, Day and Year -  current system's date.
  984.  
  985.                   FrameType - frame type "0" (double line).
  986.  
  987.                   ExitKeys - defined as ENTER, ESCAPE, TAB & SHIFTAB.
  988.  
  989.               C_DRAW - display the calendar using the current parameters.
  990.  
  991.               C_ACTIVE - display the calendar with the current parameters
  992.               and let the user change the date using the cursor keys as
  993.               follows:
  994.  
  995.                          Key               Action
  996.  
  997.                       Up Arrow       cursor one day up.
  998.                       Down Arrow     cursor one day down.
  999.                       Left Arrow     cursor one day to the left.
  1000.                       Right Arrow    cursor one day to the right.
  1001.                       Page Up        increment the month by one.
  1002.                       Page Down      decrement the month by one.
  1003.                       +              increment the year by one.
  1004.                       -              decrement the year by one.
  1005.  
  1006.               The date can also be changed by clicking the mouse buttons in
  1007.               the calendar display.
  1008.  
  1009.               C_CHECK_MOUSE - asks the function if the mouse has been
  1010.               clicked while pointing the calendar area.
  1011.  
  1012.  
  1013.  
  1014.                     SCL1 Version 3.1 - Reference Manual - Page 15
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.                                                                    Calendar
  1023.  
  1024.               C_SHADOW_ON - displays a shadow effect when the calendar is
  1025.               drawn.
  1026.  
  1027.               C_SHADOW_OFF - disables the shadow effect.
  1028.  
  1029.               C_RESET - when this message is sent the Day, Month and Year
  1030.               variables are set to the system's date. If exit keys have not
  1031.               been defined they are set to the default exit keys.
  1032.  
  1033.           The following messages can be returned by Calendar:
  1034.  
  1035.               C_OK - the action requested has been performed.
  1036.  
  1037.               C_EXIT_KEY - a key that has been defined as an exit key has
  1038.               been pressed.
  1039.  
  1040.               C_MOUSE_EVENT - the mouse has been clicked after pointing
  1041.               outside the area defined by the function.
  1042.  
  1043.               C_ILLEGAL_KEY - a key that has not been defined has been
  1044.               pressed.
  1045.  
  1046.               C_NEW_POSITION - this message is returned every time the
  1047.               month, year or day has been changed.
  1048.  
  1049.               C_MY_MOUSE - this message is returned in response to the
  1050.               C_CHECK_MOUSE message if the mouse has been pressed in the
  1051.               Calendar screen area.
  1052.  
  1053.           Example:
  1054.  
  1055.           #include <scl1.h>
  1056.  
  1057.           main()
  1058.           {
  1059.           int Mess;                        /* returned messages */
  1060.           CData test;                      /* define test as type CData */
  1061.           Calendar(C_INIT,&test);          /* Initialize to defaults */
  1062.           Calendar(C_SHADOW_ON,&test);     /* Display with shadow effect*/
  1063.           Calendar(C_DRAW,&test);          /* Display the calendar */
  1064.           do{                              /* loop until exit key */
  1065.             Mess=Calendar(C_ACTIVE,&test); /* browse */
  1066.             }while (Mess!=C_EXIT_KEY);
  1067.           }
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.                     SCL1 Version 3.1 - Reference Manual - Page 16
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.                                                    Center - ChangeDumpColor
  1084.           -----------------------------------------------------------------
  1085.                                         Center
  1086.           -----------------------------------------------------------------
  1087.  
  1088.           Purpose:    Centers a string horizontally.
  1089.  
  1090.           Prototype:  int Center(char *String);
  1091.  
  1092.           Returns:    The column position required for displaying the
  1093.                       string centered in the screen.
  1094.  
  1095.           Parameter:  String - pointer to the string to be centered (char).
  1096.  
  1097.           Example:
  1098.  
  1099.           #include <scl1.h>
  1100.  
  1101.           main()
  1102.           {
  1103.           WriteString(0x7,1,Center("Main Menu"),"Main Menu");
  1104.           }
  1105.  
  1106.  
  1107.           -----------------------------------------------------------------
  1108.                                    ChangeDumpColor
  1109.           -----------------------------------------------------------------
  1110.  
  1111.           Purpose:    Changes the color attributes of a ScreenDump array.
  1112.  
  1113.           Prototype:  void ChangeDumpColor(int OldColor,int NewColor,
  1114.                          char*Array);
  1115.  
  1116.           Returns:    Nothing
  1117.  
  1118.           Parameters:
  1119.  
  1120.               OldColor - color value you want to change (integer).
  1121.  
  1122.               NewColor - new color you desire (integer).
  1123.  
  1124.               *Array - ScreenDump array (char pointer).
  1125.  
  1126.           Example:
  1127.  
  1128.           #include <scl1.h>
  1129.  
  1130.           /*  Each character is followed by its color attribute, a \n can
  1131.               be used to indicate new lines and a "0" is used to indicate
  1132.               the end of the array */
  1133.  
  1134.           char Array[]={'A',7,'B',0x70,\n,'C',0x70,'D',7,0};
  1135.  
  1136.                     SCL1 Version 3.1 - Reference Manual - Page 17
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.                                                 ChangeDumpColor - CheckChar
  1145.  
  1146.           main()
  1147.           {
  1148.           ScreenDump(10,10,Array); /* Write at line 10, column 10 */
  1149.           GetKey();
  1150.  
  1151.           ChangeDumpColor(0x70,7,Array);/*Change color from 0x70 to 7*/
  1152.           ScreenDump(10,10,Array); /* Write at line 10, column 10 */
  1153.           }
  1154.  
  1155.           See also ScreenDump.
  1156.  
  1157.  
  1158.           -----------------------------------------------------------------
  1159.                                       CheckChar
  1160.           -----------------------------------------------------------------
  1161.  
  1162.           Purpose:    Checks for a valid keyboard character.
  1163.  
  1164.           Prototype:  unsigned int CheckChar(unsigned int Character,
  1165.                          unsigned int ControlCode);
  1166.  
  1167.           Returns:    The return value is the character, if valid, or "0"
  1168.                       if the character is not valid.
  1169.  
  1170.           Parameters:
  1171.  
  1172.               Character - character to verify (unsigned integer).
  1173.  
  1174.               ControlCode - type of character to accept (unsigned integer).
  1175.  
  1176.                   Control codes defined in SCL1.H:
  1177.  
  1178.                   CC_ANY -           accept any character.
  1179.                   CC_LETTER -        only letters.
  1180.                   CC_DIGIT -         only digits.
  1181.                   CC_CAPITALIZE -    capitalize.
  1182.                   CC_REAL -          accept real numbers.
  1183.                   CC_FILESPEC -      accept valid filename characters.
  1184.                   CC_ESPANOL -       letters & accented characters used in
  1185.                                      the spanish language.
  1186.                   CC_PUNCTUATION -   accept (,;.+-* spaces,etc.).
  1187.                   CC_PATH -          accept valid filenames and pathnames
  1188.                                      characters.
  1189.                   CC_SEARCH -        accept all characters of CC_PATH and
  1190.                                      the "*" and "?" characters.
  1191.                   CC_EXPONENTIAL -   accept numbers in exponential form.
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.                     SCL1 Version 3.1 - Reference Manual - Page 18
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.                                               CheckChar - CheckEnhancedKeyb
  1206.  
  1207.           Example:
  1208.  
  1209.           #include<scl1.h>
  1210.           #include<scl1keys.h>
  1211.  
  1212.           main()
  1213.           {
  1214.           unsigned int Key;
  1215.           Key=GetKey();
  1216.  
  1217.           if (CheckChar(Key,CC_LETTER))>0)
  1218.                   /* Character is valid */
  1219.           else
  1220.                   /* Character is invalid */
  1221.           }
  1222.  
  1223.  
  1224.           -----------------------------------------------------------------
  1225.                                   CheckEnhancedKeyb
  1226.           -----------------------------------------------------------------
  1227.  
  1228.           Purpose:    After this function is called and an enhanced
  1229.                       keyboard (101 keys) is detected, SCL1's keyboard
  1230.                       related functions will return different SCAN/ASCII
  1231.                       codes for the extra keys found in these keyboards
  1232.                       (for example; the ENTER key in the numeric keypad and
  1233.                       the regular ENTER key). These codes have been defined
  1234.                       in SCL1KEYS.H preceded by the ENH prefix. This
  1235.                       function also enables the detection of the F11 and
  1236.                       F12 function keys.
  1237.  
  1238.           Prototype:  int CheckEnhancedKeyb(void);
  1239.  
  1240.           Returns:    The return value is "1" of an enhanced keyboard is
  1241.                       detected or "0" if none is detected.
  1242.  
  1243.           Example:
  1244.  
  1245.           #include <scl1.h>
  1246.           #include <scl1keys.h>
  1247.               /* shows the use of CheckEnhancedKeyb function */
  1248.  
  1249.           main()
  1250.           {
  1251.           unsigned int Key;
  1252.  
  1253.           if(CheckEnhancedKeyb())
  1254.               printf("\nAn enhanced keyboard has been detected\n
  1255.                       Press one of your ENTER keys\nor functions keys
  1256.                       F11-F12\nESC to exit\n");
  1257.  
  1258.                     SCL1 Version 3.1 - Reference Manual - Page 19
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.                                                           CheckEnhancedKeyb
  1267.  
  1268.           else
  1269.               {
  1270.               printf("No Enhanced Keyboard available\n");
  1271.               exit(-1);
  1272.               }
  1273.  
  1274.           /*  SCL1 keyboard function will now report enhanced keyboard
  1275.               extra keys */
  1276.  
  1277.           do
  1278.               {
  1279.               switch(Key=GetKey())
  1280.                   {
  1281.                   case ENH_ENTER:
  1282.                       printf("Enhanced Enter, press the other ENTER
  1283.                          key\n");
  1284.                       break;
  1285.                   case ENTER:
  1286.                       printf("Enter, press the other ENTER key\n");
  1287.                       break;
  1288.                   case F11:
  1289.                       printf("F11\n");
  1290.                       break;
  1291.                   case F12:
  1292.                       printf("F12\n");
  1293.                       break;
  1294.                   case SHIFTF11:
  1295.                       printf("Shift F11\n");
  1296.                       break;
  1297.                   case SHIFTF12:
  1298.                       printf("Shift F12\n");
  1299.                       break;
  1300.                   case CTRLF11:
  1301.                       printf("Control F11\n");
  1302.                       break;
  1303.                   case CTRLF12:
  1304.                       printf("Control F12\n");
  1305.                       break;
  1306.                   case ALTF11:
  1307.                       printf("Alt F11\n");
  1308.                       break;
  1309.                   case ALTF12:
  1310.                       printf("Alt F12\n");
  1311.                       break;
  1312.                   default:
  1313.                       printf("Unknown key SCAN/ASCII Code: %X\n",Key);
  1314.                       break;
  1315.                   }
  1316.               }while(Key != ESC);
  1317.           }
  1318.  
  1319.                     SCL1 Version 3.1 - Reference Manual - Page 20
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.                                                               CheckItemList
  1328.           -----------------------------------------------------------------
  1329.                                     CheckItemList
  1330.           -----------------------------------------------------------------
  1331.  
  1332.           Purpose:    Checks if the mouse has been clicked at any item in
  1333.                       an item list (SEE DrawItemList).
  1334.  
  1335.           Prototype:  int CheckItemList(int Number, int ItemLength,
  1336.                          struct ItemList *il);
  1337.  
  1338.           Returns:    The number of the item selected with the mouse (>"1")
  1339.                       or "0" if none has been selected.
  1340.  
  1341.           Parameters: The item list information is given as an array of
  1342.                       structures as follows:
  1343.  
  1344.           struct ItemList{
  1345.               int Row;            Row position of the item.
  1346.  
  1347.               int Col;            Column position of the item.
  1348.  
  1349.               char *String;       Char pointer to item text.
  1350.               };
  1351.  
  1352.           The parameters passed to the function are:
  1353.  
  1354.               Number - number of items (integer).
  1355.  
  1356.               ItemLength - maximum length of items (integer).
  1357.  
  1358.               ItemList - pointer to the defined structure.
  1359.  
  1360.           Example:
  1361.  
  1362.           #include <scl1.h>
  1363.           #include <scl1clor.h>
  1364.  
  1365.           struct ItemList il[]={
  1366.               10,10,"String 1",
  1367.               10,30,"String 2",
  1368.               10,50,"String 3",
  1369.               };
  1370.  
  1371.           main()
  1372.           {
  1373.           int Selection=0;
  1374.  
  1375.           Cls(WHITE_BLACK,CLS_ALL);
  1376.           if(CheckMouse())
  1377.               InitMouse(IM_SHOW);
  1378.           else
  1379.  
  1380.                     SCL1 Version 3.1 - Reference Manual - Page 21
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.                                                  CheckItemList - CheckMouse
  1389.  
  1390.               {
  1391.               printf("No Mouse Installed\n");
  1392.               exit(-1);
  1393.               }
  1394.           DrawItemList(WHITE_BLACK,BLACK_WHITE,3,Selection,il);
  1395.           SetCurPos(14,0);
  1396.           while(Selection==0)
  1397.               {
  1398.               if(Selection=CheckItemList(3,8,il))
  1399.                   {
  1400.                   DrawItemList(WHITE_BLACK,BLACK_WHITE,3,Selection,il);
  1401.                   printf("\nOption #%i was selected\n",Selection);
  1402.                   }
  1403.               }
  1404.           exit(0);
  1405.           }
  1406.  
  1407.           NOTE:   Use DrawItemList to draw an ItemList structure to the
  1408.                   screen. See also ListManager to integrate mouse and
  1409.                   keyboard. The Dialog type function ListWindow provides an
  1410.                   alternative way to perform the same task.
  1411.  
  1412.           -----------------------------------------------------------------
  1413.                                       CheckMouse
  1414.           -----------------------------------------------------------------
  1415.  
  1416.           Purpose:    Determines if a mouse is installed.  Sets variable
  1417.                       MSE_MouseFl to "1" if mouse is found.
  1418.  
  1419.           Prototype:  int CheckMouse(void);
  1420.  
  1421.           Returns:    The return value is "1" if the mouse is installed and
  1422.                       "0" if no mouse is installed.
  1423.  
  1424.           Parameters: None
  1425.  
  1426.           Example:
  1427.  
  1428.           #include <scl1.h>
  1429.  
  1430.           main()
  1431.           {if(CheckMouse())/* do we have a mouse? */
  1432.               {
  1433.               /* Yes */
  1434.               ResetMouse(); /* reset mouse */
  1435.               SetMouseIsr();/* initialize ISR */
  1436.               ShowMouse();  /* cursor on */
  1437.               }
  1438.           ResetMouse();  /* reset mouse before exit */
  1439.           }
  1440.  
  1441.                     SCL1 Version 3.1 - Reference Manual - Page 22
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.                                                            CheckMouseButton
  1450.           -----------------------------------------------------------------
  1451.                                    CheckMouseButton
  1452.           -----------------------------------------------------------------
  1453.  
  1454.           Purpose:    Checks if the mouse has been clicked at any mouse
  1455.                       button defined using the DrawMouseButton function.
  1456.  
  1457.           Prototype:  int CheckMouseButton(int Number,
  1458.                          struct MouseButton *p);
  1459.  
  1460.           Returns:    The number of the selected screen Mouse Button or "0"
  1461.                       if none has been selected.
  1462.  
  1463.           Parameters: The Mouse Button information is specified in a
  1464.                       structure as follows:
  1465.  
  1466.           struct MouseButton{
  1467.               int Top;            Upper row position of the Mouse Button
  1468.                                   area.
  1469.  
  1470.               int Left;           Upper column position of the Button area.
  1471.  
  1472.               int Bottom;         Right row position of the Button area.
  1473.  
  1474.               int Right;          Right column position of the Button area.
  1475.  
  1476.               int Row;            Row position of the Mouse Button text.
  1477.  
  1478.               int Col;            Column position of the Button text.
  1479.  
  1480.               char String[20];    Mouse Button text (maximum of 19
  1481.                                   characters.).
  1482.               };
  1483.  
  1484.           The parameters passed to the function are:
  1485.  
  1486.               Number - number of mouse buttons (integer).
  1487.  
  1488.               MouseButton - pointer to defined structure.
  1489.  
  1490.           Example:
  1491.  
  1492.           #include <scl1.h>
  1493.           #include <scl1clor.h>
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.                     SCL1 Version 3.1 - Reference Manual - Page 23
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.                                              CheckMouseButton - ClearKeyBuf
  1511.  
  1512.           struct MouseButton mb[]={
  1513.               4,35,6,45,
  1514.               5,39,
  1515.               "YES",
  1516.               10,35,12,45,
  1517.               11,39,
  1518.               "NO",};
  1519.  
  1520.           main()
  1521.           {
  1522.           int Selection=0;
  1523.  
  1524.           Cls(WHITE_BLACK,CLS_ALL);
  1525.           if(CheckMouse())
  1526.               InitMouse(IM_SHOW);
  1527.           else
  1528.               {
  1529.               printf("No Mouse Installed\n");
  1530.               exit(-1);
  1531.               }
  1532.           DrawMouseButton(WHITE_BLACK,BLACK_WHITE,2,Selection,mb);
  1533.           SetCurPos(14,0);
  1534.           while(Selection==0)
  1535.               {
  1536.               if(Selection=CheckMouseButton(2,mb))
  1537.                   {
  1538.                   DrawMouseButton(WHITE_BLACK,BLACK_WHITE,2,Selection,mb);
  1539.                   printf("\nMouse button #%i was selected\n",Selection);
  1540.                   }
  1541.               }
  1542.           exit(0);
  1543.           }
  1544.           See also DrawMouseButton to draw the buttons.
  1545.  
  1546.  
  1547.           -----------------------------------------------------------------
  1548.                                      ClearKeyBuf
  1549.           -----------------------------------------------------------------
  1550.  
  1551.           Purpose:    Clears keyboard buffer of any character or keystroke
  1552.                       pending to be processed.
  1553.  
  1554.           Prototype:  void ClearKeyBuf(void);
  1555.  
  1556.           Returns:    Nothing.
  1557.  
  1558.           Parameters: None.
  1559.  
  1560.  
  1561.  
  1562.  
  1563.                     SCL1 Version 3.1 - Reference Manual - Page 24
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.                                                     ClearWindow - ClockTick
  1572.           -----------------------------------------------------------------
  1573.                                      ClearWindow
  1574.           -----------------------------------------------------------------
  1575.  
  1576.           Purpose:    Clears a window previously defined using the
  1577.                       InitWdata function and displayed using the
  1578.                       CreateWindow function.
  1579.  
  1580.           Prototype:  void ClearWindow(WData *wd);
  1581.  
  1582.           Returns:    Nothing
  1583.  
  1584.           Parameter:  WData - pointer to the WData structure.
  1585.  
  1586.           Example:    See InitWData
  1587.  
  1588.  
  1589.           ----------------------------------------------------------------
  1590.                                       ClockTick
  1591.           ----------------------------------------------------------------
  1592.  
  1593.           Purpose:    When this function is called the program waits for
  1594.                       the next timer interrupt before returning control to
  1595.                       the calling program or function.
  1596.  
  1597.           Prototype:  void ClockTick(void);
  1598.  
  1599.           Returns:    Nothing
  1600.  
  1601.           Parameters: None
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.                     SCL1 Version 3.1 - Reference Manual - Page 25
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.                                                                   CloseFile
  1633.           -----------------------------------------------------------------
  1634.                                       CloseFile
  1635.           -----------------------------------------------------------------
  1636.  
  1637.           Purpose:    Closes a file.
  1638.  
  1639.           Prototype:  int CloseFile(int Handle);
  1640.  
  1641.           Returns:    The DOS error code or "0" if no error occurs. (See
  1642.                       Appendix "A", FILE FUNCTIONS, for more information).
  1643.  
  1644.           Parameter:  Handle - Handle number given by DOS when you create
  1645.                       or open a file (integer).
  1646.  
  1647.           Example:
  1648.  
  1649.           #include <scl1.h>
  1650.           /* This is the source code of the Buf2Disk function */
  1651.  
  1652.           Buf2Disk(char *Filename,char *Buffer,unsigned int Bytes)
  1653.           {
  1654.           int i,handle;
  1655.  
  1656.           if(i=CreateFile(Filename,&handle,F_ARCHIVE))
  1657.               return(i);
  1658.  
  1659.           if(i=WriteFile(handle,Buffer,Bytes))
  1660.               {
  1661.               if(i > 0)
  1662.                   CloseFile(handle);
  1663.               return(i);
  1664.               }
  1665.           return(CloseFile(handle));
  1666.           }
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.                     SCL1 Version 3.1 - Reference Manual - Page 26
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.                                                                         Cls
  1694.           -----------------------------------------------------------------
  1695.                                          Cls
  1696.           -----------------------------------------------------------------
  1697.  
  1698.           Purpose:    Clears a screen area.
  1699.  
  1700.           Prototype:  void Cls(int Color,int UpperRow,int LeftCol,
  1701.                          int BottomRow,int RightCol);
  1702.  
  1703.           Returns:    Nothing
  1704.  
  1705.           Parameters:
  1706.  
  1707.               Color - color attribute of the area to be cleared (integer).
  1708.  
  1709.               UpperRow - upper row position of the area to be cleared
  1710.               (integer). Valid range from 0 to 24.
  1711.  
  1712.               LeftCol - left column position of the area to be cleared
  1713.               (integer). Valid range from 0 to 79.
  1714.  
  1715.               LowerRow - lower row position of the area to be cleared.
  1716.               (int).
  1717.  
  1718.               RightCol - right column position of the area to be cleared.
  1719.               (int).
  1720.  
  1721.           Example:
  1722.  
  1723.           #include <scl1.h>
  1724.           #include <scl1clor.h>
  1725.  
  1726.           int Color1=WHITE_BLACK;
  1727.  
  1728.           main()
  1729.           {
  1730.           Cls(Color1,18,0,24,79);
  1731.           }
  1732.  
  1733.           or,
  1734.  
  1735.           main()
  1736.           {
  1737.           Cls(Color1,CLS_ALL);
  1738.           /* CLS_ALL is defined in SCL1.H to clear the whole screen.*/
  1739.           }
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.                     SCL1 Version 3.1 - Reference Manual - Page 27
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.                                                                  CreateFile
  1755.           -----------------------------------------------------------------
  1756.                                       CreateFile
  1757.           -----------------------------------------------------------------
  1758.  
  1759.           Purpose:    Creates a new file or truncates an existing file to
  1760.                       zero.
  1761.  
  1762.           Prototype:  int CreateFile(char *Filename,int *Handle,
  1763.                          int Attrib);
  1764.  
  1765.           Returns:    the DOS error code or "0" if no error occurs. (See
  1766.                       Appendix "A", FILE FUNCTIONS, for more information).
  1767.  
  1768.           Parameters:
  1769.  
  1770.               Filename - char pointer to a valid filename.
  1771.  
  1772.               Handle - pointer to an integer variable that will contain the
  1773.               file handle number given by DOS (integer).
  1774.  
  1775.               Attrib - type of file to create, Read only, hidden, etc.
  1776.               (integer). The following types has been defined in SCL1.H:
  1777.  
  1778.                          F_READ_ONLY, F_HIDDEN, F_SYSTEM, F_VOLUME,
  1779.                          F_DIRECTORY, F_ARCHIVE
  1780.  
  1781.           Example:    See CloseFile
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.                     SCL1 Version 3.1 - Reference Manual - Page 28
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.                         CreateWindow - DestroyWindow - CursorOn - CursorOff
  1816.           -----------------------------------------------------------------
  1817.                              CreateWindow, DestroyWindow
  1818.           -----------------------------------------------------------------
  1819.  
  1820.           Purpose:    CreateWindow displays a window defined with a WData
  1821.                       structure that can be initialized using the InitWdata
  1822.                       function. This function can save the screen area in a
  1823.                       buffer, draw a frame, shadow, grow, shrink, etc.
  1824.                       These attributes are specified when the WData struct
  1825.                       is initialized.
  1826.  
  1827.                       DestroyWindow removes or deletes a window previously
  1828.                       defined using the CreateWindow function and restores
  1829.                       the screen.
  1830.  
  1831.           Prototype:  int CreateWindow(WData *wd);
  1832.                       void DestroyWindow(WData *wd);
  1833.  
  1834.           Returns:    CreateWindow can return one of the following messages
  1835.                       defined in header file SCL1.H:
  1836.  
  1837.                       W_OK if the window was created.
  1838.  
  1839.                       W_NOMEM if there is not enough memory left for the
  1840.                       window buffer.
  1841.  
  1842.                       DestroyWindow does not return values.
  1843.  
  1844.           Parameter:  WData - pointer to the WData structure.
  1845.  
  1846.           Example:    See InitWData
  1847.  
  1848.  
  1849.           -----------------------------------------------------------------
  1850.                                  CursorOff, CursorOn
  1851.           -----------------------------------------------------------------
  1852.  
  1853.           Purpose:    Turns the cursor off (not visible), or on (visible).
  1854.  
  1855.           Prototype:  void CursorOff(void);
  1856.                       void CursorOn(void);
  1857.  
  1858.           Returns:    Nothing
  1859.  
  1860.           Parameters: None
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.                     SCL1 Version 3.1 - Reference Manual - Page 29
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.                                                               C_SetUserLang
  1877.           -----------------------------------------------------------------
  1878.                                     C_SetUserLang
  1879.           -----------------------------------------------------------------
  1880.  
  1881.           Purpose:    Lets you modify the month and week day names for the
  1882.                       Calendar function.
  1883.  
  1884.           Prototype:  void C_SetUserLang(CData *cd,char **data);
  1885.  
  1886.           Returns:    Nothing.
  1887.  
  1888.           Parameters:
  1889.  
  1890.               cd - pointer to the Calendar structure.
  1891.  
  1892.               data - array that contains the user defined month names and
  1893.               week names (refer to the example).
  1894.  
  1895.           Example:
  1896.  
  1897.           /* months and weeks days in French */
  1898.  
  1899.           char *month[]={
  1900.               "Janvier",
  1901.               "Fevrier",
  1902.               "March",
  1903.               "Avril",
  1904.               "May",
  1905.               "June",
  1906.               "Julliet",
  1907.               "Aout",
  1908.               "September",
  1909.               "October",
  1910.               "Novembre",
  1911.               "Decembre",
  1912.               "  Dim Lun Mar Mer Jeu Ven Sam ", /* spaces are important */
  1913.               };
  1914.  
  1915.           /* A sample call to the function will be: */
  1916.  
  1917.           C_SetUserLang(&cd,month);
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.                     SCL1 Version 3.1 - Reference Manual - Page 30
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.                                                                    Date2Num
  1938.           -----------------------------------------------------------------
  1939.                                        Date2Num
  1940.           -----------------------------------------------------------------
  1941.  
  1942.           Purpose:    Converts a date in the format Month-Day-Year to an
  1943.                       unsigned integer number that represents the number of
  1944.                       days the have elapsed since the base date (January 1,
  1945.                       1900, which corresponds to number 1). This conversion
  1946.                       saves storage space since the date is represented as
  1947.                       an unsigned integer. This function together with
  1948.                       Num2Date permits you to perform date arithmetic, like
  1949.                       adding x number of days to a date, etc.
  1950.  
  1951.           Prototype:  unsigned int Date2Num(int Month, int Day, int Year);
  1952.  
  1953.           Returns:    An unsigned integer which represents the date or "0"
  1954.                       if an invalid date is passed to the function.
  1955.  
  1956.           Parameters:
  1957.  
  1958.               Month - a valid month number (1 to 12) (integer).
  1959.  
  1960.               Day - a valid day number (1 to 28,29,30 or 31) (integer).
  1961.  
  1962.               Year - a valid year number (four digits) from 1900 to 2077
  1963.               (int).
  1964.  
  1965.           Example:
  1966.  
  1967.           #include <scl1.h>
  1968.  
  1969.           main()
  1970.           {
  1971.           int D,M,A,W;
  1972.           unsigned int N;
  1973.  
  1974.           scanf("%i",&M);
  1975.           scanf("%i",&D);
  1976.           scanf("%i",&A);
  1977.           N=Date2Num(M,D,A);
  1978.           if(N==0)
  1979.               printf("Invalid Date");
  1980.  
  1981.           else
  1982.               {
  1983.               printf(" %ui\n",N);
  1984.               Num2Date(N,&M,&D,&A,&W);
  1985.               printf(" %i,%i,%i  %i",M,D,A,W);
  1986.               }
  1987.           }
  1988.           See also Num2Date
  1989.  
  1990.                     SCL1 Version 3.1 - Reference Manual - Page 31
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.                                                   DaysPerMonth - DeleteFile
  1999.           -----------------------------------------------------------------
  2000.                                      DaysPerMonth
  2001.           -----------------------------------------------------------------
  2002.  
  2003.           Purpose:    Returns the number of days of a given month.
  2004.  
  2005.           Prototype:  int DaysPerMonth(int year,int month);
  2006.  
  2007.           Returns:    The number of days that a given month contains.
  2008.  
  2009.           Parameters:
  2010.  
  2011.               Year - valid month year (4 digits) from 1900 to 2077 (int).
  2012.  
  2013.               Month - a valid month number (1 to 12) (integer).
  2014.  
  2015.           -----------------------------------------------------------------
  2016.                                       DeleteFile
  2017.           -----------------------------------------------------------------
  2018.  
  2019.           Purpose:    Deletes a file.
  2020.  
  2021.           Prototype:  int DeleteFile(char *Filename);
  2022.  
  2023.           Returns:    The DOS error code or "0" if no error occurs. (See
  2024.                       Appendix "A", FILE FUNCTIONS, for more information).
  2025.  
  2026.           Parameter:  Filename - char pointer to a valid filename.
  2027.  
  2028.           Example:
  2029.  
  2030.           #include <scl1.h>
  2031.           main()
  2032.           {
  2033.           int handle,i;
  2034.           i=CreateFile("SCL1.TST",&handle,F_ARCHIVE);
  2035.           if(i)
  2036.               {
  2037.               printf("\nDOS error #%i, unable to create file\n",i);
  2038.               exit(-1);
  2039.               }
  2040.           CloseFile(handle);
  2041.  
  2042.           i=DeleteFile("SCL1.TST");
  2043.           if(i)
  2044.               {
  2045.               printf("\nDOS error #%i, unable to erase file\n",i);
  2046.               exit(-1);
  2047.               }
  2048.           exit(0);
  2049.           }
  2050.  
  2051.                     SCL1 Version 3.1 - Reference Manual - Page 32
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.                                                                   DialogBox
  2060.           -----------------------------------------------------------------
  2061.                                       DialogBox
  2062.           -----------------------------------------------------------------
  2063.  
  2064.           Purpose:    Displays a dialog box at the center of the screen for
  2065.                       keyboard input. The function takes care or saving and
  2066.                       restoring the screen contents in the display area.
  2067.                       See the GetString function for the editing features.
  2068.  
  2069.           Prototype:  int DialogBox(int BoxColor,char *Prompt,
  2070.                          int InputColor,int MaxChar,
  2071.                          unsigned int CharType,char *Buffer);
  2072.  
  2073.           Returns:    The number of characters typed or "-1" if Esc is
  2074.                       pressed.
  2075.  
  2076.           Parameters:
  2077.  
  2078.               BoxColor - color attributes of the dialog box (integer).
  2079.  
  2080.               Prompt - pointer to the dialog prompt (char).
  2081.  
  2082.               InputColor - color attributes of the input (integer).
  2083.  
  2084.               MaxChar - maximum number of characters to accept (integer).
  2085.  
  2086.               CharType - the type of characters to accept as defined in
  2087.               SCL1.H (refer to the CheckChar function) (unsigned integer).
  2088.  
  2089.               Buffer - pointer to the buffer to be used to store the
  2090.               information entered, it must be one digit larger than the
  2091.               field size (for the string termination null character).
  2092.  
  2093.           Example:
  2094.  
  2095.           #include <scl1.h>
  2096.           #include <scl1clor.h>
  2097.  
  2098.           char buffer[33] /*   buffer to hold input, one character larger
  2099.                                than MaxChar */
  2100.  
  2101.           /* The following function call will display the DialogBox */
  2102.           DialogBox(WHITE_BLACK,"Filename",BLACK_WHITE,32,CC_FILESPEC,
  2103.                   buffer);
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.                     SCL1 Version 3.1 - Reference Manual - Page 33
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.                                                     DisableMouse - Dissolve
  2121.           -----------------------------------------------------------------
  2122.                                      DisableMouse
  2123.           -----------------------------------------------------------------
  2124.  
  2125.           Purpose:    Removes interrupt service routine installed by
  2126.                       SetMouseIsr
  2127.  
  2128.           Prototype:  void DisableMouse(void);
  2129.  
  2130.           Returns:    Nothing
  2131.  
  2132.           Parameters: None
  2133.  
  2134.           Example:    See CheckMouse
  2135.  
  2136.           -----------------------------------------------------------------
  2137.                                        Dissolve
  2138.           -----------------------------------------------------------------
  2139.  
  2140.           Purpose:    Clears the screen using special effects like; shrink
  2141.                       from borders to the center, horizontal shrink from
  2142.                       borders to center, etc. The function works in all
  2143.                       video modes supported by SCL1.
  2144.  
  2145.           Prototype:  void Dissolve(int Color,int Type,int Speed);
  2146.  
  2147.           Returns:    Nothing
  2148.  
  2149.           Parameters:
  2150.  
  2151.               Color - color to be used for clearing the screen (integer).
  2152.  
  2153.               Type - the clearing effect to use (integer). The following
  2154.               types have been defined in SCL1.h:
  2155.  
  2156.                   DS_BOX - use a shrinking effect from borders to center.
  2157.  
  2158.                   DS_SIDES - use an horizontal shrinking effect from
  2159.                   borders to the center.
  2160.  
  2161.                   DS_SIX_PARTS - use an horizontal shrinking effect from
  2162.                   left to right in six screen sections.
  2163.  
  2164.                   DS_FOUR_BOXES - same effect as DS_BOX but provides four
  2165.                   sections.
  2166.  
  2167.               Speed - speed to use for the clearing effect in hundredths of
  2168.               a second (integer). The recommended speed is 1 hundredths of
  2169.               a second.
  2170.  
  2171.  
  2172.  
  2173.                     SCL1 Version 3.1 - Reference Manual - Page 34
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.                                                                    Dissolve
  2182.           Example:
  2183.  
  2184.           #include <scl1.h>
  2185.           #include <scl1clor.h>
  2186.  
  2187.           /* Shows several dissolve effects for clearing the screen */
  2188.  
  2189.           main()
  2190.           {
  2191.           int Color1,Color2;
  2192.  
  2193.           if(Video()==COLOR)
  2194.               {
  2195.               Color1=WHITE_BLACK;
  2196.               Color2=BROWN_BLACK+HIGHLIGHT;
  2197.               }
  2198.           else
  2199.               {
  2200.               Color1=WHITE_BLACK;
  2201.               Color2=WHITE_BLACK+HIGHLIGHT;
  2202.               }
  2203.  
  2204.           /* Fill screen with X */
  2205.           FillBlock(Color2,0,0,VC_Lines-1,VC_Cols-1,'X');
  2206.           WaitTime(50);                           /* 1/2 second delay */
  2207.           Dissolve(Color1,DS_BOX,1);              /* Clear screen */
  2208.           WaitTime(50);
  2209.  
  2210.           FillBlock(Color2,0,0,VC_Lines-1,VC_Cols-1,'X');
  2211.           WaitTime(100);
  2212.           Dissolve(Color1,DS_SIDES,1);
  2213.           WaitTime(50);
  2214.  
  2215.           FillBlock(Color2,0,0,VC_Lines-1,VC_Cols-1,'X');
  2216.           WaitTime(100);
  2217.           Dissolve(Color1,DS_SIX_PARTS,1);
  2218.           WaitTime(50);
  2219.  
  2220.           FillBlock(Color2,0,0,VC_Lines-1,VC_Cols-1,'X');
  2221.           WaitTime(100);
  2222.           Dissolve(Color1,DS_FOUR_BOXES,1);
  2223.           }
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.                     SCL1 Version 3.1 - Reference Manual - Page 35
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.                                                                 DrawBoxLine
  2243.           -----------------------------------------------------------------
  2244.                                      DrawBoxLine
  2245.           -----------------------------------------------------------------
  2246.  
  2247.           Purpose:    Draws either vertical or horizontal lines inside a
  2248.                       box with the proper end line characters.
  2249.  
  2250.           Prototype:  void DrawBoxLine(int Color,int FrameType,int Row1,
  2251.                          int Col1,int Row2,int Col2);
  2252.  
  2253.           Returns:    Nothing
  2254.  
  2255.           Parameters:
  2256.  
  2257.               Color - color attributes of the line to be drawn (integer).
  2258.  
  2259.               FrameType - type of frame used to draw the box (integer).
  2260.  
  2261.               Row1 - row position where the line starts (integer).
  2262.  
  2263.               Col1 - column position where the line starts (integer).
  2264.  
  2265.               Row2 - row position where the line ends (integer).
  2266.  
  2267.               Col2 - column position where the line ends (integer).
  2268.  
  2269.           Note:   To draw horizontal lines both Row1 and Row2 must have the
  2270.                   same value, for vertical lines both Col1 and Col2 must
  2271.                   have the same value.
  2272.  
  2273.           Example:
  2274.  
  2275.           #include <scl1.h>
  2276.           #include <scl1clor.h>
  2277.  
  2278.           int Color1=WHITE_BLACK;
  2279.  
  2280.           main()
  2281.           {
  2282.           Box(Color1,0,0,0,24,79);         /* Full screen box */
  2283.           DrawBoxLine(Color1,0,5,0,5,79);  /* Horizontal line in row 5*/
  2284.           DrawBoxLine(Color1,0,5,39,24,39);/* Vertical line between rows 5
  2285.                                               and 24 */
  2286.           }
  2287.  
  2288.           See also Box, GSSBox, DrawLine
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.                     SCL1 Version 3.1 - Reference Manual - Page 36
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.                                                                DrawItemList
  2304.           -----------------------------------------------------------------
  2305.                                      DrawItemList
  2306.           -----------------------------------------------------------------
  2307.  
  2308.           Purpose:    Draws a list of strings to the screen and permits the
  2309.                       user to browse through them. The selected item (>0)
  2310.                       is drawn in the color specified with SelectedColor.
  2311.  
  2312.           Prototype:  void DrawItemList(int NormalColor,int SelectedColor,
  2313.                          int Number,int Selection,Struct ItemList *il);
  2314.  
  2315.           Returns:    Nothing
  2316.  
  2317.           Parameters: The ItemList information must be given as an array of
  2318.                       structures as follows:
  2319.  
  2320.           struct ItemList{
  2321.               int Row;         Row position of the item.
  2322.  
  2323.               int Col;         Column position of the item.
  2324.  
  2325.               char *String;    Char pointer to item text.
  2326.               };
  2327.  
  2328.           The parameters passed to the function are:
  2329.  
  2330.               NormalColor - color for the normal display of items
  2331.               (integer).
  2332.  
  2333.               SelectedColor - color for the display of the selected item
  2334.               (integer).
  2335.  
  2336.               Number - number of items to be displayed (integer).
  2337.  
  2338.               Selection - default selection to be displayed when entering
  2339.               the function (integer).
  2340.  
  2341.               ItemList - pointer to a previously defined ItemList
  2342.               structure.
  2343.  
  2344.           Example:    See CheckItemList
  2345.  
  2346.           NOTE:   The ScrollWindow and ListWindow functions provide
  2347.                   alternatives to perform the same tasks.
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.                     SCL1 Version 3.1 - Reference Manual - Page 37
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.                                                                    DrawLine
  2365.           -----------------------------------------------------------------
  2366.                                        DrawLine
  2367.           -----------------------------------------------------------------
  2368.  
  2369.           Purpose:    Draws either vertical or horizontal lines.
  2370.  
  2371.           Prototype:  void DrawLine(int Color,int Row,int Col,int Count,
  2372.                          int Direction,int Character);
  2373.  
  2374.           Returns:    Nothing
  2375.  
  2376.           Parameters:
  2377.  
  2378.               Color - color attributes of the line to be drawn (integer).
  2379.  
  2380.               Row - row position where the line starts (integer).
  2381.  
  2382.               Col - column position where the line starts (integer).
  2383.  
  2384.               Count - number of line characters to be drawn (integer).
  2385.  
  2386.               Direction - direction to draw. Constants DL_HORIZONTAL and
  2387.               DL_VERTICAL has been defined in SCL1.H.
  2388.  
  2389.               Character - graphic character to use for line drawing (int).
  2390.  
  2391.           Example:
  2392.  
  2393.           #include <scl1.h>
  2394.           #include <scl1clor.h>
  2395.  
  2396.           int Color1=WHITE_BLACK;
  2397.  
  2398.           main()
  2399.           {
  2400.           DrawLine(Color1,5,5,10,DL_HORIZONTAL,196);
  2401.           /* Horizontal line in row 5, between columns 5 and 15 */
  2402.  
  2403.           DrawLine(Color1,5,5,14,DL_VERTICAL,179);
  2404.           /* Vertical line between rows 5 and 19, column 5 */
  2405.           }
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.                     SCL1 Version 3.1 - Reference Manual - Page 38
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.                                                             DrawMouseButton
  2426.           -----------------------------------------------------------------
  2427.                                    DrawMouseButton
  2428.           -----------------------------------------------------------------
  2429.  
  2430.           Purpose:    Draws one or more Mouse Buttons. The selected button
  2431.                       is drawn inside a double line box. A mouse button
  2432.                       consists of a text prompt inside a box. You can
  2433.                       select the mouse button by clicking the mouse after
  2434.                       pointing it.
  2435.  
  2436.           Prototype:  void DrawMouseButton(int NormalColor,
  2437.                          int SelectedColor,int Number,int Selection,
  2438.                          struct MouseButton *p);
  2439.  
  2440.           Returns:    Nothing.
  2441.  
  2442.           Parameters: The Mouse Button information must be given as an
  2443.                       array of structures:
  2444.  
  2445.           struct MouseButton{
  2446.               int Top;         Upper row position of the Mouse Button area.
  2447.  
  2448.               int Left;        Upper column position of the Mouse Button
  2449.                                area.
  2450.  
  2451.               int Bottom;      Right row position of the Mouse Button area.
  2452.  
  2453.               int Right;       Right column position of the Mouse Button
  2454.                                area.
  2455.  
  2456.               int Row;         Row position of the Mouse Button text.
  2457.  
  2458.               int Col;         Column position of the Mouse Button text.
  2459.  
  2460.               char String[20]; Mouse Button text (19 characters maximum)
  2461.               };
  2462.  
  2463.           The parameters passed to the function are:
  2464.  
  2465.               NormalColor - color used when button is not selected
  2466.  
  2467.               SelectedColor - Color used for a selected button (integer).
  2468.  
  2469.               Number - Number of buttons in the structure (integer).
  2470.  
  2471.               Selection - Number of the selected button (0 for none) (int).
  2472.  
  2473.               MouseButton - pointer to predefined structure.
  2474.  
  2475.           Example:    See CheckMouseButton
  2476.  
  2477.  
  2478.                     SCL1 Version 3.1 - Reference Manual - Page 39
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.                                                              EB_SetUserLang
  2487.           -----------------------------------------------------------------
  2488.                                     EB_SetUserLang
  2489.           -----------------------------------------------------------------
  2490.  
  2491.           Purpose:    Lets you modify the default prompts of the ErrorBox
  2492.                       function. With it you can customize the default
  2493.                       "Press any key to Continue" and "Unknown Error"
  2494.                       prompts. This is useful when writing programs in
  2495.                       languages other that English. Error messages can be
  2496.                       defined using the InitUserError function. See
  2497.                       ErrorBox for default messages.
  2498.  
  2499.           Prototype:  void EB_SetUserLang(char *prompt1,char *prompt2);
  2500.  
  2501.           Returns:    Nothing.
  2502.  
  2503.           Parameters:
  2504.  
  2505.               prompt1 - char pointer to the first prompt, whose default is
  2506.               "Press any key to Continue".
  2507.  
  2508.               prompt2 - char pointer to the second prompt, whose default is
  2509.               "Unknown Error".
  2510.  
  2511.           Example:
  2512.  
  2513.           /* this function call sets the ErrorBox prompts to Spanish */
  2514.  
  2515.           EB_SetUserLang("Oprima cualquier tecla para Continuar","Error
  2516.           Desconocido");
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.                     SCL1 Version 3.1 - Reference Manual - Page 40
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.                                                                   EMS_Alloc
  2548.           -----------------------------------------------------------------
  2549.                                       EMS_Alloc
  2550.           -----------------------------------------------------------------
  2551.  
  2552.           Purpose:    Allocates the number of pages requested and assigns
  2553.                       an EMM handle to these pages. The EMM handle owns
  2554.                       these pages until they are deallocated.
  2555.  
  2556.           Prototype:  int EMS_Alloc(int handle,int pages);
  2557.  
  2558.           Returns:    Returns one of the following messages defined in
  2559.                       header file SCL1EMS.H:
  2560.  
  2561.                       EMS_OK if EMS has allocated the requested pages.
  2562.  
  2563.                       EMS_NOT_IMPLEMENTED if the function code passed to
  2564.                       the memory manager is not defined.
  2565.  
  2566.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  2567.                       manager software is detected.
  2568.  
  2569.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  2570.                       memory hardware is detected.
  2571.  
  2572.                       EMS_NO_MORE_HANDLE if all EMM handles are being used.
  2573.  
  2574.                       EMS_LOG_GREATER_PH if there are not enough expanded
  2575.                       memory pages present in the system to satisfy the
  2576.                       request.
  2577.  
  2578.                       EMS_LOG_GREATER_AVA if there are not enough
  2579.                       unallocated pages to satisfy the request.
  2580.  
  2581.                       EMS_ZERO_ALLOC if you attempted to allocate zero
  2582.                       pages.
  2583.  
  2584.           Parameters:
  2585.  
  2586.               handle - the EMM handle your program received from a call to
  2587.               the EMS_Alloc function (integer).
  2588.  
  2589.               pages - the number of pages you want your program to allocate
  2590.               (integer).
  2591.  
  2592.           Example:    See EMS_Init
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.                     SCL1 Version 3.1 - Reference Manual - Page 41
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.                                                       EMS_AvailableLogPages
  2609.           -----------------------------------------------------------------
  2610.                                 EMS_AvailableLogPages
  2611.           -----------------------------------------------------------------
  2612.  
  2613.           Purpose:    Returns the number of unallocated pages of expanded
  2614.                       memory.
  2615.  
  2616.           Prototype:  int EMS_AvailableLogPages(unsigned int *npages);
  2617.  
  2618.           Returns:    Returns one of the following messages defined in
  2619.                       header file SCL1EMS.H:
  2620.  
  2621.                       EMS_OK if EMS has returned the number of unallocated
  2622.                       pages and the number of total pages in expanded
  2623.                       memory.
  2624.  
  2625.                       EMS_NOT_IMPLEMENTED if the function code passed to
  2626.                       the manager is not defined.
  2627.  
  2628.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  2629.                       manager software is detected.
  2630.  
  2631.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  2632.                       memory hardware is detected.
  2633.  
  2634.           Parameter:  npages - pointer to an unsigned int that will be set
  2635.                       to the number of currently available pages
  2636.                       (unallocated).
  2637.  
  2638.           Example:    See EMS_Init
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.                     SCL1 Version 3.1 - Reference Manual - Page 42
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.                                                     EMS_Exchange - EMS_Move
  2670.           -----------------------------------------------------------------
  2671.                                 EMS_Exchange, EMS_Move
  2672.           -----------------------------------------------------------------
  2673.  
  2674.           Purpose:    Exchanges or moves a region of memory from
  2675.                       conventional to conventional memory, conventional to
  2676.                       expanded memory, expanded to conventional memory or
  2677.                       expanded to expanded memory.
  2678.  
  2679.           Prototype:  int EMS_Exchange(EMSMove *);
  2680.  
  2681.                       int EMS_Move(EMSMove *);
  2682.  
  2683.           Returns:    Returns one of the following messages defined in
  2684.                       header file SCL1EMS.H:
  2685.  
  2686.                       EMS_OK if the memory regions have been exchanged or
  2687.                       moved.
  2688.  
  2689.                       EMS_NOT_IMPLEMENTED if the function code passed to
  2690.                       the EMS manager is not defined.
  2691.  
  2692.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  2693.                       manager software is detected.
  2694.  
  2695.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  2696.                       memory hardware is detected.
  2697.  
  2698.                       EMS_INVALID_HANDLE if the manager could not find
  2699.                       either the source or destination EMM handles.
  2700.  
  2701.                       EMS_INVALID_LOG if one or more of the logical pages
  2702.                       is out of the range of logical pages allocated to the
  2703.                       source/destination handle.
  2704.  
  2705.                       EMS_S_NOT_IMPLEMENTED if EMS subfunction is invalid.
  2706.  
  2707.                       EMS_SOURCE_OVERWRITTEN if the source and destination
  2708.                       expanded memory regions have the same handle and
  2709.                       overlap.  This is valid for a move. The move has been
  2710.                       completed and the destination region has a copy of
  2711.                       the source region. However, at least a portion of the
  2712.                       source region has been overwritten by the move.
  2713.  
  2714.                       EMS_SIZE_ERROR if the length of the source or
  2715.                       destination expanded memory region specified exceeds
  2716.                       the length of the expanded memory region allocated
  2717.                       either the source or destination handle.
  2718.  
  2719.                       EMS_OVERLAP if the conventional memory region and
  2720.                       expanded memory region overlap.
  2721.  
  2722.                     SCL1 Version 3.1 - Reference Manual - Page 43
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.                                                     EMS_Exchange - EMS_Move
  2731.  
  2732.                       EMS_OFFSET_ERROR if the offset within the logical
  2733.                       page exceeds the length of the logical page.
  2734.  
  2735.                       EMS_TOO_BIG if a region length exceeds 1M byte.
  2736.  
  2737.                       EMS_UNDEFINED_TYPE if the memory source and
  2738.                       destination types are undefined.
  2739.  
  2740.                       EMS_WRAP_ERROR if an attempt was made to wrap around
  2741.                       the 1M-byte address space of conventional memory
  2742.                       during the move.
  2743.  
  2744.                       EMS_OVERLAP_ERROR if the source and destination
  2745.                       expanded memory regions have the same handle and
  2746.                       overlap.
  2747.  
  2748.           Parameter:  The parameter is a pointer to a an EMSMove structure
  2749.                       as follows:
  2750.  
  2751.           typedef struct{
  2752.               unsigned long bytes;   Specifies the length of the memory
  2753.                                      region to be exchanged or moved.
  2754.  
  2755.               char stype;            Type of memory where the source region
  2756.                                      resides. EMS_CONVENTIONAL_MEM
  2757.                                      indicates that the source region
  2758.                                      resides in conventional memory.
  2759.                                      EMS_EXPANDED_MEM indicates that the
  2760.                                      source region resides in expanded
  2761.                                      memory.
  2762.  
  2763.               unsigned int shandle;  If the source region resides in
  2764.                                      expanded memory, shandle specifies the
  2765.                                      handle number associated with the
  2766.                                      source memory region. If the source
  2767.                                      region resides in conventional memory,
  2768.                                      shandle has no meaning and should be
  2769.                                      set to zero.
  2770.  
  2771.               unsigned int soffset;  Specifies the offset within the source
  2772.                                      region from which to do the exchange
  2773.                                      or move. If the source region resides
  2774.                                      in expanded memory, this offset is
  2775.                                      relative to the beginning of the 16K
  2776.                                      logical page. If the source region
  2777.                                      resides in conventional memory,
  2778.                                      soffset specifies the offset, relative
  2779.                                      to the beginning of the source
  2780.                                      segment, from which to do the exchange
  2781.                                      or move.
  2782.  
  2783.                     SCL1 Version 3.1 - Reference Manual - Page 44
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.                                                     EMS_Exchange - EMS_Move
  2792.  
  2793.               unsigned int sseg;     Specifies the initial segment or
  2794.                                      logical page number within the source
  2795.                                      region from which to do the exchange
  2796.                                      or move. If the source region resides
  2797.                                      in expanded memory, sseg specifies the
  2798.                                      logical page within the source region
  2799.                                      from which to do the exchange or move.
  2800.                                      If the source region resides in
  2801.                                      conventional memory, sseg specifies
  2802.                                      the initial segment address within
  2803.                                      conventional memory from which to do
  2804.                                      the exchange or move.
  2805.  
  2806.               char dtype;            Specifies the type of memory where the
  2807.                                      destination region resides.
  2808.  
  2809.               unsigned int dhandle;  If the destination region resides in
  2810.                                      expanded memory, dhandle specifies the
  2811.                                      handle number associated with the
  2812.                                      destination memory region. If the
  2813.                                      destination region resides in
  2814.                                      conventional memory, dhandle has no
  2815.                                      meaning and should be set to zero.
  2816.  
  2817.               unsigned int doffset;  specifies the offset within the
  2818.                                      destination region from which to do
  2819.                                      the exchange or move. If this region
  2820.                                      resides in expanded memory, doffset is
  2821.                                      relative to the beginning of the
  2822.                                      logical page. If the destination
  2823.                                      region resides in conventional memory,
  2824.                                      doffset specifies the offset, relative
  2825.                                      to the beginning of the destination
  2826.                                      segment, to do the exchange or move.
  2827.  
  2828.               unsigned int dseg;     specifies the initial segment or
  2829.                                      logical page number within the
  2830.                                      destination region from which to do
  2831.                                      the exchange or move. If the
  2832.                                      destination region resides in expanded
  2833.                                      memory then dseg specifies the logical
  2834.                                      page within the destination region
  2835.                                      from which to do the exchange or move.
  2836.                                      If the destination region resides in
  2837.                                      conventional memory, dseg specifies
  2838.                                      the initial segment address within
  2839.                                      conventional memory from which to do
  2840.                                      the exchange or move.
  2841.               }EMSMove;
  2842.           Example:    See EMS_Init
  2843.  
  2844.                     SCL1 Version 3.1 - Reference Manual - Page 45
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.                                                                    EMS_Free
  2853.           -----------------------------------------------------------------
  2854.                                        EMS_Free
  2855.           -----------------------------------------------------------------
  2856.  
  2857.           Purpose:    Deallocates the logical pages currently allocated to
  2858.                       an EMM handle. Only after the application deallocates
  2859.                       these pages can other applications use them. When a
  2860.                       handle is deallocated, its name is set to all ASCII
  2861.                       nulls (binary zeros). A program must perform this
  2862.                       function before it exits to DOS. If it doesn't, no
  2863.                       other programs can use these pages or the EMM handle.
  2864.  
  2865.           Prototype:  int EMS_Free(int handle);
  2866.  
  2867.           Returns:    Returns one of the following messages defined in
  2868.                       header file SCL1EMS.H:
  2869.  
  2870.                       EMS_OK if EMS has deallocated the requested pages
  2871.                       previously allocated.
  2872.  
  2873.                       EMS_NOT_IMPLEMENTED if the function code passed to
  2874.                       the memory manager is not defined.
  2875.  
  2876.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  2877.                       manager software is detected.
  2878.  
  2879.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  2880.                       memory hardware is detected.
  2881.  
  2882.                       EMS_INVALID_HANDLE if the specified EMM handle cannot
  2883.                       be found.
  2884.  
  2885.                       EMS_SAVE_REST_ERROR if the memory manager detected a
  2886.                       save or restore page mapping context error
  2887.                       (EMS_SavePageMap or EMS_RestorePageMap functions);
  2888.  
  2889.           Parameter:  handle - EMM handle. This handle is returned by the
  2890.                       EMS_Alloc function.
  2891.  
  2892.           Example:    See EMS_Init
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.                     SCL1 Version 3.1 - Reference Manual - Page 46
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.                                                       EMS_GetAllHandlePages
  2914.           -----------------------------------------------------------------
  2915.                                 EMS_GetAllHandlePages
  2916.           -----------------------------------------------------------------
  2917.  
  2918.           Purpose:    Returns an array of the open EMM handles and the
  2919.                       number of pages allocated to each one.
  2920.  
  2921.           Prototype:  int EMS_GetAllHandlePages(EMSHandle *p,int *entries);
  2922.  
  2923.           Returns:    Returns one of the following messages defined in
  2924.                       header file SCL1EMS.H:
  2925.  
  2926.                       EMS_OK if EMS has returned the array.
  2927.  
  2928.                       EMS_NOT_IMPLEMENTED if the function code passed to
  2929.                       the manager is not defined.
  2930.  
  2931.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  2932.                       manager software is detected.
  2933.  
  2934.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  2935.                       memory hardware is detected.
  2936.  
  2937.           Parameters: The parameter is a pointer to a an EMSHandle
  2938.                       structure as follows:
  2939.  
  2940.               typedef struct{
  2941.                   unsigned int handle;  Contains the value of the open EMM
  2942.                                         handle. The values of the handles
  2943.                                         this function returns will be in
  2944.                                         the range of 0 to 255 decimal
  2945.                                         (0000h to 00FFh). The uppermost
  2946.                                         byte of the handle is always zero.
  2947.  
  2948.                   unsigned int pages;   Contains the number of pages
  2949.                                         allocated to the open EMM handle.
  2950.                   }EMSHandle;
  2951.  
  2952.           Parameter:  entries - pointer to an integer value that will be
  2953.                       set to the number of open EMM handles (including the
  2954.                       operating system handle [0]). The number cannot be
  2955.                       zero because the operating system handle is always
  2956.                       active and cannot be deallocated. This number will
  2957.                       not exceed 255.
  2958.  
  2959.           Example:    See EMS_Init
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.                     SCL1 Version 3.1 - Reference Manual - Page 47
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.                                                          EMS_GetHandleCount
  2975.           -----------------------------------------------------------------
  2976.                                   EMS_GetHandleCount
  2977.           -----------------------------------------------------------------
  2978.  
  2979.           Purpose:    Returns the number of open EMM handles (including the
  2980.                       operating system handle 0) in the system.
  2981.  
  2982.           Prototype:  int EMS_GetHandleCount(int *ActiveHandles);
  2983.  
  2984.           Returns:    Returns one of the following messages defined in
  2985.                       header file SCL1EMS.H:
  2986.  
  2987.                       EMS_OK if EMS has returned the number of active EMM
  2988.                       handles.
  2989.  
  2990.                       EMS_NOT_IMPLEMENTED if the function code passed to
  2991.                       the manager is not defined.
  2992.  
  2993.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  2994.                       manager software is detected.
  2995.  
  2996.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  2997.                       memory hardware is detected.
  2998.  
  2999.           Parameter:  ActiveHandles - pointer to an integer value that will
  3000.                       be set to the number of open EMM handles [including
  3001.                       the operating system handle (0)].This number will not
  3002.                       exceed 255.
  3003.  
  3004.           Example:    See EMS_Init
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.                     SCL1 Version 3.1 - Reference Manual - Page 48
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.                                                           EMS_GetHandleName
  3036.           -----------------------------------------------------------------
  3037.                                   EMS_GetHandleName
  3038.           -----------------------------------------------------------------
  3039.  
  3040.           Purpose:    Gets the eight character name currently assigned to a
  3041.                       handle. There is no restriction on the characters
  3042.                       which may be used in the handle name.
  3043.  
  3044.           Prototype:  int EMS_GetHandleName(int handle,char *name);
  3045.  
  3046.           Returns:    Returns one of the following messages defined in
  3047.                       header file SCL1EMS.H:
  3048.  
  3049.                       EMS_OK if EMS has returned the handle name.
  3050.  
  3051.                       EMS_NOT_IMPLEMENTED if the function code passed to
  3052.                       the manager is not defined.
  3053.  
  3054.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3055.                       manager software is detected.
  3056.  
  3057.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  3058.                       memory hardware is detected.
  3059.  
  3060.                       EMS_INVALID_HANDLE if EMS couldn't find the EMM
  3061.                       handle your program specified.
  3062.  
  3063.                       EMS_S_NOT_IMPLEMENTED if an EMS subfunction is
  3064.                       invalid
  3065.  
  3066.           Parameters:
  3067.  
  3068.               handle - contains the EMM handle (integer).
  3069.  
  3070.               name - pointer to an array which will be set to the name
  3071.               associated with the specified handle.
  3072.  
  3073.           Example:    See EMS_Init
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.                     SCL1 Version 3.1 - Reference Manual - Page 49
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.                                                          EMS_GetHandlePages
  3097.           -----------------------------------------------------------------
  3098.                                   EMS_GetHandlePages
  3099.           -----------------------------------------------------------------
  3100.  
  3101.           Purpose:    Returns the number of pages allocated to a specific
  3102.                       EMM handle.
  3103.  
  3104.           Prototype:  int EMS_GetHandlePages(int Handle,int *Pages);
  3105.  
  3106.           Returns:    Returns one of the following messages defined in
  3107.                       header file SCL1EMS.H:
  3108.  
  3109.                       EMS_OK if EMS has returned the number of pages
  3110.                       allocated to the EMM handle.
  3111.  
  3112.                       EMS_NOT_IMPLEMENTED if the function code passed to
  3113.                       the manager is not defined.
  3114.  
  3115.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3116.                       manager software is detected.
  3117.  
  3118.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  3119.                       memory hardware is detected.
  3120.  
  3121.                       EMS_INVALID_HANDLE if EMS couldn't find the EMM
  3122.                       handle your program specified.
  3123.  
  3124.           Parameters:
  3125.  
  3126.               Handle - contains the EMM handle (integer).
  3127.  
  3128.               Pages - pointer to an integer value that will be set to the
  3129.               number of logical pages allocated to the specified EMM
  3130.               handle. This number never exceeds 2048 because the memory
  3131.               manager allows a maximum of 2048 pages (32M bytes) of
  3132.               expanded memory.
  3133.  
  3134.           Example:    See EMS_Init
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.                     SCL1 Version 3.1 - Reference Manual - Page 50
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.                                                                    EMS_Init
  3158.           -----------------------------------------------------------------
  3159.                                        EMS_Init
  3160.           -----------------------------------------------------------------
  3161.  
  3162.           Purpose:    Initialize the Expanded Memory Management functions.
  3163.                       Determine if a valid Expanded Memory Manager (EMS
  3164.                       driver) has been installed in your system.
  3165.  
  3166.           Prototype:  int EMS_Init(void);
  3167.  
  3168.           Returns:    Returns one of the following messages defined in
  3169.                       header file SCL1EMS.H:
  3170.  
  3171.                       EMS_OK if EMS has been initialized.
  3172.  
  3173.                       EMS_NOT_IMPLEMENTED if EMS has not been implemented.
  3174.  
  3175.           Parameters: None
  3176.  
  3177.           Example:
  3178.  
  3179.  
  3180.           #include <memory.h>
  3181.           #include <dos.h>
  3182.           #include <scl1ems.h>
  3183.  
  3184.           /* Shows the use of EMS (Expanded memory functions */
  3185.  
  3186.           void HandleReport(void);
  3187.           void Pause(void);
  3188.           void PrintError(unsigned int Error);
  3189.  
  3190.           char *TestStr[]={
  3191.               "Data for Page 0",
  3192.               "Data for Page 1",
  3193.               "Data for Page 2",
  3194.               "Data for Page 3",
  3195.               };
  3196.  
  3197.           typedef struct{
  3198.               unsigned int ErrorCode;
  3199.               char *ErrorMess;
  3200.               }EMSERRORS;
  3201.  
  3202.           EMSERRORS emse[]=
  3203.               {
  3204.               EMS_NOT_AVAILABLE      ,"EMS is not available",
  3205.               EMS_INTERNAL_ERROR     ,"Internal EMM error",
  3206.               EMS_HARDWARE_ERROR     ,"Hardware Error",
  3207.               EMS_MANAGER_BUSY       ,"EMS Manager busy",
  3208.               EMS_INVALID_HANDLE     ,"Invalid handle",
  3209.  
  3210.                     SCL1 Version 3.1 - Reference Manual - Page 51
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.                                                                    EMS_Init
  3219.  
  3220.               EMS_NOT_IMPLEMENTED    ,"Function is not implemented",
  3221.               EMS_NO_MORE_HANDLE     ,"No more handles available",
  3222.               EMS_SAVE_REST_ERROR    ,"Save/restore error",
  3223.               EMS_LOG_GREATER_PH     ,"Not enough physical pages",
  3224.               EMS_LOG_GREATER_AVA    ,"Not enough available logical pages",
  3225.               EMS_ZERO_ALLOC         ,"Allocation of 0 pages",
  3226.               EMS_INVALID_LOG        ,"Invalid logical page number",
  3227.               EMS_INVALID_PH         ,"Invalid physical page number",
  3228.               EMS_STATE_SAVE_FULL    ,"Save Stack full",
  3229.               EMS_SAVE_ALREADY       ,"Already saved",
  3230.               EMS_RESTORE_FAIL       ,"Failure restoring",
  3231.               EMS_S_NOT_IMPLEMENTED  ,"Subfunction number not implemented",
  3232.               EMS_SOURCE_OVERWRITTEN ,"Source overwritten",
  3233.               EMS_SIZE_ERROR         ,"Size error",
  3234.               EMS_OVERLAP            ,"Overlapping regions",
  3235.               EMS_OFFSET_ERROR       ,"Offset error",
  3236.               EMS_TOO_BIG            ,"Size too big",
  3237.               EMS_OVERLAP_ERROR      ,"Overlapping error",
  3238.               EMS_UNDEFINED_TYPE     ,"Undefined memory type",
  3239.               EMS_DUPLICATE          ,"Duplicate handle name",
  3240.               EMS_WRAP_ERROR         ,"Wrap error",
  3241.               };
  3242.  
  3243.           EMSMove emove;
  3244.           char HandleName[9]="SCL1V30";
  3245.  
  3246.           main()
  3247.           {
  3248.           char buffer[80];
  3249.           int i,handle;
  3250.           unsigned int ppages,lpages;
  3251.           void far *p,far *s;
  3252.           void *t;
  3253.  
  3254.           printf("\n\nSCL1 Version 3.1 Expanded Memory (EMS) Test\n");
  3255.  
  3256.           /* Initialize expanded memory manager */
  3257.  
  3258.           if(EMS_Init() != EMS_OK)
  3259.               {
  3260.  
  3261.               /* no EMS available */
  3262.  
  3263.               printf("No EMS available\n");
  3264.               exit(-1);
  3265.               }
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.                     SCL1 Version 3.1 - Reference Manual - Page 52
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.                                                                    EMS_Init
  3280.  
  3281.               /* Get EMM version number */
  3282.  
  3283.           EMS_Version(&i);
  3284.           memset(buffer,0,sizeof(buffer));
  3285.  
  3286.           /*  use predefined macros to get the major and minor version
  3287.               number add 0x30 to these values to convert to ASCII, store in
  3288.               buffer */
  3289.  
  3290.           buffer[0]=EMS_MAJOR_VER(i) + 0x30;
  3291.           buffer[1]='.';
  3292.           buffer[2]=EMS_MINOR_VER(i) + 0x30;
  3293.  
  3294.               /* print version number */
  3295.  
  3296.           printf("EMS version: %s\n",buffer);
  3297.  
  3298.               /* get EMM status and print answer */
  3299.  
  3300.           printf("EMS status: ");
  3301.           if((i=EMS_Status())==EMS_OK)
  3302.               printf("OK\n");
  3303.           else
  3304.               PrintError(i);
  3305.  
  3306.           Pause();
  3307.  
  3308.               /* get physical pages info */
  3309.  
  3310.           printf("Physical pages report\n");
  3311.  
  3312.               /* get total number of physical pages */
  3313.  
  3314.           EMS_TotalPhPages(&ppages);
  3315.           printf("\tTotal physical pages: %i\n",ppages);
  3316.  
  3317.               /* get each physical page address */
  3318.  
  3319.           for(i=0;i < ppages;++i)
  3320.               {
  3321.               EMS_PageAddress(i,&p);
  3322.               printf("\tPhysical page %i address %X:%X\n",i,FP_SEG(p),
  3323.                       FP_OFF(p));
  3324.               if(i > 0 && i % 21 == 0)
  3325.                   Pause();
  3326.               }
  3327.  
  3328.           Pause();
  3329.  
  3330.  
  3331.  
  3332.                     SCL1 Version 3.1 - Reference Manual - Page 53
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.                                                                    EMS_Init
  3341.  
  3342.               /* get logical pages info */
  3343.  
  3344.           printf("Logical pages report\n");
  3345.  
  3346.               /* get total number of logical pages */
  3347.  
  3348.           EMS_TotalLogPages(&lpages);
  3349.           printf("\tTotal logical pages: %i\n",lpages);
  3350.  
  3351.               /* get number of available logical pages */
  3352.  
  3353.           EMS_AvailableLogPages(&lpages);
  3354.           printf("\tAvailable logical pages: %i\n",lpages);
  3355.           Pause();
  3356.  
  3357.           printf("Allocation/mapping/reallocation Test\n");
  3358.  
  3359.           if(lpages)
  3360.               {
  3361.  
  3362.               /* allocate all available memory */
  3363.  
  3364.               if((i=EMS_Alloc(&handle,lpages))==EMS_OK)
  3365.                   {
  3366.                   printf("\tSuccesful allocation of %i pages\n",lpages);
  3367.  
  3368.                   if(EMS_SetHandleName(handle,HandleName)==EMS_OK)
  3369.                       {
  3370.                       printf("\tEMS handle has been named %s\n",
  3371.                              HandleName);
  3372.                       if(EMS_GetNamedHandle(HandleName,&i)==EMS_OK)
  3373.                          printf("\tHandle number is %i\n",i);
  3374.                       }
  3375.  
  3376.                   /* print memory handle info */
  3377.  
  3378.                   HandleReport();
  3379.  
  3380.                   for(i=0;i < lpages,i < 4;++i)
  3381.                       {
  3382.                       printf("\tMapping Logical Page %i to Physical Page
  3383.                              %i\n",i,i);
  3384.                       EMS_Map(handle,i,i);
  3385.                       EMS_PageAddress(i,&p);
  3386.                       printf("\tPhysical page %i segment: %X\n",i,
  3387.                               FP_SEG(p));
  3388.                       printf("\tWriting to logical page %i\n",i);
  3389.                       _fmemcpy(p,TestStr[i],sizeof(TestStr[i]));
  3390.                       printf("\tCopying from expanded memory to
  3391.                              conventional  memory using EMS_Move\n");
  3392.  
  3393.                     SCL1 Version 3.1 - Reference Manual - Page 54
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.                                                                    EMS_Init
  3402.  
  3403.                       /* copy page 0 to our conventional memory buffer */
  3404.  
  3405.                       emove.bytes=sizeof(TestStr[i]);
  3406.                       emove.stype=EMS_EXPANDED_MEM;
  3407.                       emove.shandle=handle;
  3408.                       emove.soffset=0;
  3409.                       emove.sseg=0;
  3410.                       emove.dtype=EMS_CONVENTIONAL_MEM;
  3411.                       emove.dhandle=0;
  3412.                       s=(void far *)buffer;
  3413.                       emove.doffset=FP_OFF(s);
  3414.                       emove.dseg=FP_SEG(s);
  3415.                       EMS_Move(&emove);
  3416.  
  3417.                       /* compare our buffer with page 0 */
  3418.  
  3419.                       if(_fmemcmp(p,(void far *)buffer,sizeof(TestStr[i]))
  3420.                                   ==0)
  3421.                          printf("\tLogical page %i copied to conventional
  3422.                                   memory, compares OK\n",i);
  3423.                       else
  3424.                          printf("\tLogical page %i copied to conventional
  3425.                                   memory, error in compare\n",i);
  3426.                       Pause();
  3427.                       }
  3428.  
  3429.                   /* re-allocate to 1 page (16Kb) */
  3430.  
  3431.                   if((i=EMS_Realloc(handle,1))==EMS_OK)
  3432.                       {
  3433.                       printf("\tReallocated to 1 page\n");
  3434.  
  3435.                       /* print memory handle info */
  3436.  
  3437.                       HandleReport();
  3438.                       }
  3439.  
  3440.                   /* free allocated memory */
  3441.  
  3442.                   EMS_Free(handle);
  3443.                   }
  3444.               else
  3445.                   printf("\tError allocating EMS %x\n",i);
  3446.               }
  3447.           }
  3448.  
  3449.  
  3450.  
  3451.  
  3452.  
  3453.  
  3454.                     SCL1 Version 3.1 - Reference Manual - Page 55
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.                                                                    EMS_Init
  3463.  
  3464.           void HandleReport(void)
  3465.           {
  3466.           EMSHandle p[255];
  3467.           char buffer[9];
  3468.  
  3469.           int i;
  3470.  
  3471.               /*  get number of active handles */
  3472.  
  3473.           memset(buffer,0,sizeof(buffer));
  3474.  
  3475.           EMS_GetHandleCount(&i);
  3476.           printf("\tHandle report\n");
  3477.           printf("\t\tActive handles: %i\n",i);
  3478.  
  3479.               /*  print the number of memory pages associated with each
  3480.                   handle */
  3481.  
  3482.           if(EMS_GetAllHandlePages(p,&i)==EMS_OK)
  3483.               {
  3484.               while(i--)
  3485.                   {
  3486.                   EMS_GetHandleName(p[i].handle,buffer);
  3487.                   printf("\t\tHandle %s %i, %i pages\n",buffer,p[i].handle,
  3488.                          p[i].pages);
  3489.                   }
  3490.               }
  3491.           }
  3492.  
  3493.           void Pause(void)
  3494.           {
  3495.           printf("-- more --");
  3496.           GetKey();
  3497.           printf("\r          \n");
  3498.           }
  3499.  
  3500.           void PrintError(unsigned int Error)
  3501.           {
  3502.           int i;
  3503.  
  3504.           for(i=0;i < sizeof(emse) /sizeof(EMSERRORS);++i)
  3505.               {
  3506.               if(emse[i].ErrorCode==Error)
  3507.                   {
  3508.                   printf("\t%s\n",emse[i].ErrorMess);
  3509.                   return;
  3510.                   }
  3511.               }
  3512.           printf("\tUnknown error #%X\n",Error);
  3513.           }
  3514.  
  3515.                     SCL1 Version 3.1 - Reference Manual - Page 56
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.                                                                     EMS_Map
  3524.           -----------------------------------------------------------------
  3525.                                        EMS_Map
  3526.           -----------------------------------------------------------------
  3527.  
  3528.           Purpose:    Maps a logical page at a specific physical page
  3529.                       anywhere in the mappable regions of memory. It can
  3530.                       also unmap physical pages, making them inaccessible
  3531.                       for reading or writing by setting its associated
  3532.                       logical page to FFFFh.
  3533.  
  3534.           Prototype:  int EMS_Map(int handle,int ppage,int lpage);
  3535.  
  3536.           Returns:    Returns one of the following messages defined in
  3537.                       header file SCL1EMS.H:
  3538.  
  3539.                       EMS_OK if EMS has mapped the page.
  3540.  
  3541.                       EMS_NOT_IMPLEMENTED if the function code passed to
  3542.                       the memory manager is not defined.
  3543.  
  3544.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3545.                       manager software is detected.
  3546.  
  3547.                       EMS_HARDWARE_ERROR if a problem in the expanded
  3548.                       memory hardware is detected.
  3549.  
  3550.                       EMS_INVALID_HANDLE if EMS could not find the handle
  3551.                       specified.
  3552.  
  3553.                       EMS_INVALID_LOG if the logical page is out of the
  3554.                       range of logical pages which are allocated to the EMM
  3555.                       handle or if a program attempts to map a logical page
  3556.                       when no logical pages are allocated to the handle.
  3557.  
  3558.                       EMS_INVALID_PH if the physical page number is out of
  3559.                       the range of allowable physical pages.
  3560.  
  3561.           Parameters:
  3562.  
  3563.               handle -  the EMM handle your program received from a call to
  3564.               the EMS_Alloc function (integer).
  3565.  
  3566.               ppage - the number of the physical page into which the
  3567.               logical page number is to be mapped.  Physical pages are
  3568.               numbered zero-relative (integer).
  3569.  
  3570.               lpage - the number of the logical page to be mapped at the
  3571.               physical page within the page frame. Logical pages are
  3572.               numbered zero-relative (integer).
  3573.  
  3574.           Example:    See EMS_Init
  3575.  
  3576.                     SCL1 Version 3.1 - Reference Manual - Page 57
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.                                                          EMS_MapMultipleEMS
  3585.           -----------------------------------------------------------------
  3586.                                   EMS_MapMultipleEMS
  3587.           -----------------------------------------------------------------
  3588.  
  3589.           Purpose:    Map (or unmap) logical pages into as many physical
  3590.                       pages as the system supports.
  3591.  
  3592.           Prototype:  int EMS_MapMultipleEMS(int handle,int entries,
  3593.                          EMSMap *parameter);
  3594.  
  3595.           Returns:    Returns one of the following messages defined in
  3596.                       header file SCL1EMS.H:
  3597.  
  3598.                       EMS_OK if EMS the logical pages have been mapped, or
  3599.                       unmapped, at the specified physical pages.
  3600.  
  3601.                       EMS_NOT_IMPLEMENTED if the function code passed to
  3602.                       the manager is not defined.
  3603.  
  3604.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3605.                       manager software is detected.
  3606.  
  3607.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  3608.                       memory hardware is detected.
  3609.  
  3610.                       EMS_INVALID_HANDLE if it couldn't find the specified
  3611.                       EMM handle.
  3612.  
  3613.                       EMS_S_NOT_IMPLEMENTED if an EMS subfunction is
  3614.                       invalid.
  3615.  
  3616.                       EMS_INVALID_LOG if one or more of the mapped pages is
  3617.                       out of the range of logical pages which are allocated
  3618.                       to the EMM handle or if a program attempts to map a
  3619.                       logical page when no logical pages are allocated to
  3620.                       the handle.
  3621.  
  3622.                       EMS_INVALID_PH if one or more of the physical pages
  3623.                       out of the range of mappable physical pages.
  3624.  
  3625.           Parameters:
  3626.  
  3627.               handle - the EMM handle your program received from a call to
  3628.               the EMS_Alloc function (integer).
  3629.  
  3630.               entries - contains the number of pages to map in the array
  3631.               (integer).
  3632.  
  3633.               parameter - pointer to an array of structures of the type
  3634.               EMSHandle as follows:
  3635.  
  3636.  
  3637.                     SCL1 Version 3.1 - Reference Manual - Page 58
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.                                         EMS_MapMultipleEMS - EMS_PageAdress
  3646.  
  3647.               typedef struct{
  3648.                   unsigned int logpage; The number of the logical page to
  3649.                                         be mapped from zero to (maximum
  3650.                                         number of logical pages allocated
  3651.                                         to the handle - 1). If the logical
  3652.                                         page number is set to FFFFh, the
  3653.                                         physical page is unmapped.
  3654.  
  3655.                   unsigned int phpage;  The number of the physical page at
  3656.                                         which the logical page is to be
  3657.                                         mapped from zero to (maximum number
  3658.                                         of physical pages supported in the
  3659.                                         system - 1).
  3660.                   }EMSMap;
  3661.  
  3662.           Example:    See EMS_Init
  3663.  
  3664.           -----------------------------------------------------------------
  3665.                                     EMS_PageAdress
  3666.           -----------------------------------------------------------------
  3667.           Purpose:    Returns the address of a desired physical page
  3668.                       number.
  3669.  
  3670.           Prototype:  int EMS_PageAdress(int page,void far * far * pagept);
  3671.  
  3672.           Returns:    Returns one of the following messages defined in
  3673.                       header file SCL1EMS.H:
  3674.  
  3675.                       EMS_OK if EMS has allocated the requested pages to
  3676.                       the assigned EMM handle.
  3677.  
  3678.                       EMS_NOT_IMPLEMENTED if the function code passed to
  3679.                       the memory manager is not defined.
  3680.  
  3681.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3682.                       manager software is detected.
  3683.  
  3684.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  3685.                       memory hardware is detected.
  3686.  
  3687.                       EMS_NO_MORE_HANDLE if all EMM handles are being used.
  3688.  
  3689.                       EMS_LOG_GREATER_PH if there aren't enough expanded
  3690.                       memory pages present in the system to satisfy your
  3691.                       program's request.
  3692.  
  3693.                       EMS_LOG_GREATER_AVA if there aren't enough
  3694.                       unallocated pages to satisfy your program's request.
  3695.  
  3696.  
  3697.  
  3698.                     SCL1 Version 3.1 - Reference Manual - Page 59
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.                                                EMS_PageAdress - EMS_Realloc
  3707.  
  3708.                       EMS_ZERO_ALLOC if your program attempted to allocate
  3709.                       zero pages.
  3710.  
  3711.           Parameters:
  3712.  
  3713.               page - desired physical page number (integer).
  3714.  
  3715.               pagept - pointer to a pointer that will contain the address
  3716.               of the desired page number.
  3717.  
  3718.           Example:    See EMS_Init
  3719.  
  3720.           -----------------------------------------------------------------
  3721.                                      EMS_Realloc
  3722.           -----------------------------------------------------------------
  3723.  
  3724.           Purpose:    Allows an application program to increase or decrease
  3725.                       (reallocate) the number of logical pages allocated to
  3726.                       an EMM handle.
  3727.  
  3728.           Prototype:  int EMS_Realloc(int handle,int pages);
  3729.  
  3730.           Returns:    Returns one of the following messages defined in
  3731.                       header file SCL1EMS.H:
  3732.  
  3733.                       EMS_OK if EMS has returned the array.
  3734.  
  3735.                       EMS_NOT_IMPLEMENTED if the function code passed to
  3736.                       the manager is not defined.
  3737.  
  3738.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3739.                       manager software is detected.
  3740.  
  3741.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  3742.                       memory hardware is detected.
  3743.  
  3744.           Parameters:
  3745.  
  3746.               handle - the EMM handle your program received from a call to
  3747.               the EMS_Alloc function (integer).
  3748.  
  3749.               pages - contains the new size of the allocated memory block
  3750.               (unsigned integer).
  3751.  
  3752.           Example:    See EMS_Init
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.                     SCL1 Version 3.1 - Reference Manual - Page 60
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.                                                          EMS_RestorePageMap
  3768.           -----------------------------------------------------------------
  3769.                                   EMS_RestorePageMap
  3770.           -----------------------------------------------------------------
  3771.  
  3772.           Purpose:    Restores the page mapping register contents on the
  3773.                       expanded memory boards for a particular EMM handle.
  3774.                       This function lets your program restore the contents
  3775.                       of the mapping registers its EMM handle saved.
  3776.  
  3777.           Prototype:  int EMS_RestorePageMap(int handle);
  3778.  
  3779.           Returns:    Returns one of the following messages defined in
  3780.                       header file SCL1EMS.H:
  3781.  
  3782.                       EMS_OK if EMS has restored the state of the page
  3783.                       mapping registers.
  3784.  
  3785.                       EMS_NOT_IMPLEMENTED if the function code passed to
  3786.                       the memory manager is not defined.
  3787.  
  3788.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3789.                       manager software is detected.
  3790.  
  3791.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  3792.                       memory hardware is detected.
  3793.  
  3794.                       EMS_INVALID_HANDLE if the specified EMM handle cannot
  3795.                       be found.
  3796.  
  3797.                       EMS_RESTORE_FAIL if there is no page mapping register
  3798.                       state in the save area for the specified EMM handle.
  3799.                       Your program didn't save the contents of the page
  3800.                       mapping hardware, so Restore Page can't restore it.
  3801.  
  3802.           Parameter:  handle - the EMM handle your program received from a
  3803.                       call to the EMS_Alloc function (integer).
  3804.  
  3805.           Example:    See EMS_Init
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.                     SCL1 Version 3.1 - Reference Manual - Page 61
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.                                                             EMS_SavePageMap
  3829.           -----------------------------------------------------------------
  3830.                                    EMS_SavePageMap
  3831.           -----------------------------------------------------------------
  3832.  
  3833.           Purpose:    Saves the contents of the page mapping registers on
  3834.                       all expanded memory boards in an internal save area.
  3835.                       The function is typically used to save the memory
  3836.                       mapping context of the EMM handle that was active
  3837.                       when a software or hardware interrupt occurred.
  3838.  
  3839.           Prototype:  int EMS_SavePageMap(int handle);
  3840.  
  3841.           Returns:    Returns one of the following messages defined in
  3842.                       header file SCL1EMS.H:
  3843.  
  3844.                       EMS_OK if EMS has saved the state of the page mapping
  3845.                       hardware.
  3846.  
  3847.                       EMS_NOT_IMPLEMENTED if the function code passed to
  3848.                       the memory manager is not defined.
  3849.  
  3850.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3851.                       manager software is detected.
  3852.  
  3853.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  3854.                       memory hardware is detected.
  3855.  
  3856.                       EMS_INVALID_HANDLE if the specified EMM handle cannot
  3857.                       be found.
  3858.  
  3859.                       EMS_STATE_SAVE_FULL if there is no room in the save
  3860.                       area to store the state of the page mapping
  3861.                       registers. The state of the map registers has not
  3862.                       been saved.
  3863.  
  3864.                       EMS_SAVE_ALREADY if the save area already contains
  3865.                       the page mapping register state for the EMM handle
  3866.                       your program specified.
  3867.  
  3868.           Parameter:  handle - the EMM handle your program received from a
  3869.                       call to the EMS_Alloc function (integer).
  3870.  
  3871.           Example:    See EMS_Init
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.                     SCL1 Version 3.1 - Reference Manual - Page 62
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.                                                           EMS_SetHandleName
  3890.           -----------------------------------------------------------------
  3891.                                   EMS_SetHandleName
  3892.           -----------------------------------------------------------------
  3893.  
  3894.           Purpose:    Assigns an eight character name to a handle. There is
  3895.                       no restriction on the characters which may be used in
  3896.                       the handle name. The full range of values may be
  3897.                       assigned to each character in a name (that is, 00h
  3898.                       through FFh).
  3899.  
  3900.           Prototype:  int EMS_SetHandleName(int handle,char *name);
  3901.  
  3902.           Returns:    Returns one of the following messages defined in
  3903.                       header file SCL1EMS.H:
  3904.  
  3905.                       EMS_OK if EMS has assigned the handle name.
  3906.  
  3907.                       EMS_NOT_IMPLEMENTED if the function code passed to
  3908.                       the manager is not defined.
  3909.  
  3910.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3911.                       manager software is detected.
  3912.  
  3913.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  3914.                       memory hardware is detected.
  3915.  
  3916.                       EMS_INVALID_HANDLE if EMS couldn't find the EMM
  3917.                       handle your program specified.
  3918.  
  3919.                       EMS_S_NOT_IMPLEMENTED if an EMS subfunction is
  3920.                       invalid.
  3921.  
  3922.                       EMS_DUPLICATE if a handle with the specified name
  3923.                       already exists.  The specified handle was not
  3924.                       assigned a name.
  3925.  
  3926.           Parameters:
  3927.  
  3928.               handle - contains the EMM handle (integer).
  3929.  
  3930.               name - pointer to an array which contains the name that is to
  3931.               be assigned to the handle. The handle name must be padded
  3932.               with nulls if the name is less than eight characters long.
  3933.  
  3934.           Example:    See EMS_Init
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.                     SCL1 Version 3.1 - Reference Manual - Page 63
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.                                                                  EMS_Status
  3951.           -----------------------------------------------------------------
  3952.                                       EMS_Status
  3953.           -----------------------------------------------------------------
  3954.  
  3955.           Purpose:    Returns a status code indicating whether the memory
  3956.                       manager is present and the hardware is working
  3957.                       correctly.
  3958.  
  3959.           Prototype:  int EMS_Status(void);
  3960.  
  3961.           Returns:    Returns one of the following messages defined in
  3962.                       header file SCL1EMS.H:
  3963.  
  3964.                       EMS_OK if EMS is present in the system, and the
  3965.                       hardware is working correctly.
  3966.  
  3967.                       EMS_NOT_IMPLEMENTED if EMS has not been implemented.
  3968.  
  3969.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  3970.                       manager software is detected.
  3971.  
  3972.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  3973.                       memory hardware is detected.
  3974.  
  3975.           Parameters: None
  3976.  
  3977.           Example:    See EMS_Init
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.                     SCL1 Version 3.1 - Reference Manual - Page 64
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.                                                           EMS_TotalLogPages
  4012.           -----------------------------------------------------------------
  4013.                                   EMS_TotalLogPages
  4014.           -----------------------------------------------------------------
  4015.  
  4016.           Purpose:    Returns the total number of expanded memory pages.
  4017.  
  4018.           Prototype:  int EMS_TotalLogPages(unsigned int *npages);
  4019.  
  4020.           Returns:    Returns one of the following messages defined in
  4021.                       header file SCL1EMS.H:
  4022.  
  4023.                       EMS_OK if EMS has returned the number of unallocated
  4024.                       pages and the number of total pages in expanded
  4025.                       memory.
  4026.  
  4027.                       EMS_NOT_IMPLEMENTED if the function code passed to
  4028.                       the manager is not defined.
  4029.  
  4030.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  4031.                       manager software is detected.
  4032.  
  4033.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  4034.                       memory hardware is detected.
  4035.  
  4036.           Parameter:  npages - pointer to an unsigned integer that will
  4037.                       contain the number of expanded memory pages that are
  4038.                       available.
  4039.  
  4040.           Example:    See EMS_Init
  4041.  
  4042.  
  4043.  
  4044.  
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.                     SCL1 Version 3.1 - Reference Manual - Page 65
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.                                                                 EMS_Version
  4073.           -----------------------------------------------------------------
  4074.                                      EMS_Version
  4075.           -----------------------------------------------------------------
  4076.  
  4077.           Purpose:    Returns the version number of the memory manager
  4078.                       software.
  4079.  
  4080.           Prototype:  int EMS_Version(unsigned int *version);
  4081.  
  4082.           Returns:    Returns one of the following messages defined in
  4083.                       header file SCL1EMS.H:
  4084.  
  4085.                       EMS_OK if EMS has been initialized and the hardware
  4086.                       is working correctly.
  4087.  
  4088.                       EMS_NOT_IMPLEMENTED if the function code passed to
  4089.                       the memory manager is not defined.
  4090.  
  4091.                       EMS_INTERNAL_ERROR if a malfunction in the memory
  4092.                       manager software is detected.
  4093.  
  4094.                       EMS_HARDWARE_ERROR if a malfunction in the expanded
  4095.                       memory hardware is detected.
  4096.  
  4097.           Parameter:  version - pointer that will contain the memory
  4098.                       manager's version number in binary coded decimal
  4099.                       (BCD) format. The upper four bits contain the integer
  4100.                       digit of the version number. The lower four bits
  4101.                       contain the fractional digit of version number
  4102.                       (unsigned integer).
  4103.  
  4104.               Two macros EMS_MAJOR_VER(i) and EMS_MINOR_VER(i) have been
  4105.               defined int SCL1EMS.H. These macros extract the EMS version
  4106.               number from the variable version.
  4107.  
  4108.               To get the most significant part (MAJOR) of the version
  4109.               number use the following relation:
  4110.  
  4111.               Major=EMS_MAJOR_VER(i);
  4112.  
  4113.               The get the least significant part (MINOR) of the version
  4114.               number use the following relation:
  4115.  
  4116.               Minor=EMS_MINOR_VER(i);
  4117.  
  4118.               The EMS driver version number will be:
  4119.  
  4120.               Version Number = Major.Minor
  4121.  
  4122.           Example:    See EMS_Init
  4123.  
  4124.  
  4125.                     SCL1 Version 3.1 - Reference Manual - Page 66
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.  
  4132.  
  4133.                                                                    ErrorBox
  4134.           -----------------------------------------------------------------
  4135.                                        ErrorBox
  4136.           -----------------------------------------------------------------
  4137.  
  4138.           Purpose:    Displays a box, centered in the screen, with an error
  4139.                       message. Standard error messages have been defined.
  4140.                       You can add your own error messages or modify the
  4141.                       standard messages with the InitUserError function and
  4142.                       your own prompts with the EB_SetUserLang function. To
  4143.                       define the color attributes and a shadow effect use
  4144.                       ErrorShadowOff, ErrorShadowOn and SetErrorBoxColor.
  4145.  
  4146.           Prototype:  void ErrorBox(int ErrNum);
  4147.  
  4148.           Returns:    Nothing.
  4149.  
  4150.           Parameters: ErrNum - error number corresponding to the error
  4151.                       message to be displayed (integer).
  4152.  
  4153.           The error numbers defined are:
  4154.  
  4155.                   ERROR           DESCRIPTION
  4156.                    2              File not found
  4157.                    3              Path not found
  4158.                    4              Not enough handles
  4159.                    5              Access denied
  4160.                    6              Invalid handle
  4161.                    7              Memory control blocks destroyed
  4162.                    8              Insufficient memory
  4163.                    9              Invalid memory block address
  4164.                   10              Invalid environment
  4165.                   15              Invalid drive
  4166.                   18              No files found
  4167.                   27              Sector not found
  4168.                   29              Write Error
  4169.                   30              Read Error
  4170.                   255             File too Big
  4171.                   -1              DOS Critical Error
  4172.  
  4173.           Example:
  4174.  
  4175.           #include <scl1.h>
  4176.  
  4177.           struct ErrorMess em[]={
  4178.               256,"Please type either Y for YES\nor N for NO",
  4179.               0};
  4180.  
  4181.           main()
  4182.           {
  4183.           int Key;
  4184.  
  4185.  
  4186.                     SCL1 Version 3.1 - Reference Manual - Page 67
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.                                   ErrorBox - ErrorShadowOff - ErrorShadowOn
  4195.  
  4196.           InitUserError(em);
  4197.           printf("\nInstall printer driver? (Y/N)\n");
  4198.           do
  4199.               {
  4200.               Key=toupper(getch());
  4201.               if(Key != 'Y' && Key != 'N')
  4202.                   ErrorBox(256);
  4203.               else
  4204.                   break;
  4205.               }while(1);
  4206.           }
  4207.  
  4208.           See ErrorShadowOff, ErrorShadowOn, SetErrorBoxColor, 
  4209.           InitUserError and EB_SetUserLang.
  4210.  
  4211.           -----------------------------------------------------------------
  4212.                             ErrorShadowOff, ErrorShadowOn
  4213.           -----------------------------------------------------------------
  4214.  
  4215.           Purpose:    Enables or disables a shadow effect when using the
  4216.                       ErrorBox function. Subsequent calls to ErrorBox will
  4217.                       be displayed with (or without) a shadow effect.
  4218.  
  4219.           Prototype:  void ErrorShadowOff(void);
  4220.                       void ErrorShadowOn(void);
  4221.  
  4222.           Returns:    Nothing.
  4223.  
  4224.           Parameters: None.
  4225.  
  4226.           Example:
  4227.  
  4228.           #include <scl1.h>
  4229.  
  4230.           struct ErrorMess em[]={
  4231.               1000,"ErrorBox without shadow",
  4232.               1001,"ErrorBox with shadow",
  4233.               0};
  4234.  
  4235.           main()
  4236.           {
  4237.           InitUserError(em);
  4238.           SetShadowColor(8);
  4239.           ErrorBox(1000);
  4240.           ErrorShadowOn();
  4241.           ErrorBox(1001);
  4242.           ErrorShadowOff();
  4243.           ErrorBox(1000);
  4244.           }
  4245.           See ErrorBox, InitUserError and SetErrorBoxColor.
  4246.  
  4247.                     SCL1 Version 3.1 - Reference Manual - Page 68
  4248.  
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.                           FB_SetUserLang - FB3_SetUserLang - WF_SetUserLang
  4256.           -----------------------------------------------------------------
  4257.                    FB_SetUserLang, FB3_SetUserLang, WF_SetUserLang
  4258.           -----------------------------------------------------------------
  4259.  
  4260.           Purpose:    Lets you modify the default prompts of the FileBox
  4261.                       and FileBox2 (FB_SetUserLang), FileBox3
  4262.                       (FB3_SetUserLang) or WFileBox (WF_SetUserLang)
  4263.                       functions. With this function you can customize the
  4264.                       default "Load" "Cancel" and "Dir" prompts. This can
  4265.                       useful when writing programs in languages other than
  4266.                       english.
  4267.  
  4268.           Prototype:  void FB_SetUserLang(char **prompt,int offset1,
  4269.                          int offset2);
  4270.  
  4271.                       void FB3_SetUserLang(char **prompt,int offset1,
  4272.                          int offset2);
  4273.  
  4274.                       void FB_SetUserLang(char **prompt,int offset1,
  4275.                          int offset2);
  4276.  
  4277.           Returns:    Nothing.
  4278.  
  4279.           Parameters:
  4280.  
  4281.               prompt - pointer to a null terminated array of char pointers
  4282.               that holds the modified prompts.
  4283.  
  4284.               offset1 - distance from the right margin (left margin for
  4285.               WF_SetUserLang) of the box where the first mouse button
  4286.               ("LOAD") will be displayed.
  4287.  
  4288.               offset2 - distance from the right margin (left margin for
  4289.               WF_SetUserLang) of the box where the second mouse button
  4290.               ("CANCEL") will be displayed.
  4291.  
  4292.           Example:
  4293.  
  4294.           /* this function call sets the FileBox prompts to Spanish */
  4295.  
  4296.           char *myprompts[]={
  4297.               "< ACEPTAR >",
  4298.               "< CANCELAR >",
  4299.               ">>>>",
  4300.               0,
  4301.               };
  4302.           FB_SetUserLang(myprompts,3,3);
  4303.  
  4304.  
  4305.  
  4306.  
  4307.  
  4308.                     SCL1 Version 3.1 - Reference Manual - Page 69
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.                                                                  FieldCheck
  4317.           -----------------------------------------------------------------
  4318.                                       FieldCheck
  4319.           -----------------------------------------------------------------
  4320.  
  4321.           Purpose:    This function is designed to be used with the Fields2
  4322.                       function. When using Fields2 you must specify a
  4323.                       function (in the FData1 structure) to handle events. 
  4324.                       It receives messages from Fields2 and must act upon
  4325.                       them returning messages telling whether the cursor
  4326.                       should move to the next or previous field, stay at
  4327.                       the same position or exit the function. This function
  4328.                       can, at the same time, monitor the data that is being
  4329.                       entered and display help or error messages, if
  4330.                       necessary. The FieldCheck function has been designed
  4331.                       to handle the most typical events that are likely to
  4332.                       occur when using Fields2:
  4333.  
  4334.                       TAB - Moves the cursor to the next field.
  4335.  
  4336.                       SHIFT+TAB - Moves the cursor to the previous field.
  4337.  
  4338.                       ESC - Exit Fields2.
  4339.  
  4340.                       ENTER - Its action depends on the active field type. 
  4341.                       When LineEditor, TagItem or Select fields are active,
  4342.                       pressing ENTER moves control to the next field. When
  4343.                       ScrollWindow or ListWindow are active, pressing ENTER
  4344.                       will select the highlighted item. When MouseButton is
  4345.                       active, it works as an exit key.
  4346.  
  4347.                       MOUSE EVENTS - Handles all mouse events.
  4348.  
  4349.                       It is recommended that you always use FieldCheck.
  4350.                       Even if you need to define your own field checking
  4351.                       function for data validation or other purposes, you
  4352.                       can still call FieldCheck from your function so that
  4353.                       you don't need to care about the handling of the
  4354.                       events mentioned above.
  4355.  
  4356.           Prototype:  int FieldCheck(FData2 *p);
  4357.  
  4358.           Returns:    The return value is a message.  Please refer to the
  4359.                       Fields2 function for details.
  4360.  
  4361.           Parameters: The required parameter is a pointer to the FData2
  4362.                       structure of the field to be checked.
  4363.  
  4364.           Example:    See Fields2
  4365.  
  4366.  
  4367.  
  4368.  
  4369.                     SCL1 Version 3.1 - Reference Manual - Page 70
  4370.  
  4371.  
  4372.  
  4373.  
  4374.  
  4375.  
  4376.  
  4377.                                                                      Fields
  4378.           -----------------------------------------------------------------
  4379.                                         Fields
  4380.           -----------------------------------------------------------------
  4381.  
  4382.           Purpose:    This function permits you to make data entry screens.
  4383.                       The fields can accept keyboard input and permit
  4384.                       editing. You can move across the fields using the
  4385.                       TAB, SHIFTTAB keys or your mouse. An exit key is
  4386.                       defined when calling the function. You can define a
  4387.                       data validation and a help function associated with
  4388.                       each field. When you reach each field's end, the
  4389.                       cursor jumps to the next field, thus special field
  4390.                       types (such as date fields) can be defined as
  4391.                       separate fields make them look as one.
  4392.  
  4393.           Prototype:  int Fields(int NColor, int RColor, int NFields,
  4394.                          struct InputFields *ifld, unsigned int ExitKey,
  4395.                          unsigned int HelpKey);
  4396.  
  4397.           Returns:    Returns "1" if a key defined as an exit key is
  4398.                       pressed and "-1" if the ESC key is pressed.
  4399.  
  4400.           Parameters: The fields information must entered as an array of
  4401.                       structures as follows:
  4402.  
  4403.           struct InputFields{
  4404.               int PromptLine;        Row position to start the prompt
  4405.                                      display.
  4406.  
  4407.               int PromptCol;         Column to start the prompt display.
  4408.  
  4409.               char *Prompt;          Char pointer to the prompt to be
  4410.                                      displayed.
  4411.  
  4412.               int FieldLine;         Row to start the field display.
  4413.  
  4414.               int FieldCol;          Column to start the field display.
  4415.  
  4416.               char *FieldBuffer;     Pointer to the buffer to be used to
  4417.                                      store the field contents.
  4418.  
  4419.               int MaxChar;           Length of the input field.
  4420.  
  4421.               int CharType;          Mask of valid characters as described
  4422.                                      in function CheckChar.
  4423.  
  4424.               int (* Helpf)(struct InputFields *p);
  4425.                   pointer to a help function. This function receives a
  4426.                   pointer to the fields structure and must be user
  4427.                   supplied.
  4428.  
  4429.  
  4430.                     SCL1 Version 3.1 - Reference Manual - Page 71
  4431.  
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.                                                                      Fields
  4439.  
  4440.               int (* CheckF)(struct InputFields *p);
  4441.                   pointer to a field validation function. This function
  4442.                   receives a pointer to the fields structure and must be
  4443.                   user supplied. It must return a value of "0" if the field
  4444.                   fails the test or a value of "1" to accept the entry.
  4445.               };
  4446.  
  4447.           The parameters required are:
  4448.  
  4449.               NColor - color attributes for the prompt display (int).
  4450.  
  4451.               RColor - color attributes for the field display (integer).
  4452.  
  4453.               NFields - number of fields (integer).
  4454.  
  4455.               InputFields - pointer to the InputFields structure.
  4456.  
  4457.               ExitKey - key to be used to exit the fields screen (unsigned
  4458.               integer).
  4459.  
  4460.               HelpKey - key to be used for calling a help function
  4461.               (unsigned integer).
  4462.  
  4463.           Example:
  4464.  
  4465.           #include <scl1.h>
  4466.           #include <scl1keys.h>
  4467.           #include <scl1clor.h>
  4468.  
  4469.           int test(struct InputFields *p);
  4470.           int helpf(struct InputFields *p);
  4471.  
  4472.           char buffer1[29];
  4473.           char buffer2[29];
  4474.           char buffer3[29];
  4475.           char buffer4[29];
  4476.           char buffer5[13];
  4477.           char buffer6[11];
  4478.           char buffer7[11];
  4479.           char buffer8[11];
  4480.           char buffer9[9];
  4481.           char buffer10[11];
  4482.  
  4483.           struct InputFields data[]={
  4484.               4,3,"Name:",4,11,buffer1,28,CC_ANY,helpf,test,
  4485.               6,3,"Address:",6,11,buffer2,28,CC_ANY,helpf,test,
  4486.               8,3,"City:",8,11,buffer3,28,CC_ANY | CC_CAPITALIZE,helpf,
  4487.                   test,
  4488.               10,3,"State:",10,11,buffer4,28,CC_LETTER | CC_PUNCTUATION |
  4489.                   CC_CAPITALIZE,helpf,test,
  4490.  
  4491.                     SCL1 Version 3.1 - Reference Manual - Page 72
  4492.  
  4493.  
  4494.  
  4495.  
  4496.  
  4497.  
  4498.  
  4499.                                                                      Fields
  4500.  
  4501.               12,3,"Zip:",12,11,buffer5,12,CC_DIGIT,helpf,test,
  4502.               4,44,"Customer Number:",4,60,buffer6,10,CC_DIGIT,helpf,test,
  4503.               6,44,"Amount Due:   $",6,60,buffer7,10,CC_REAL,helpf,test,
  4504.               8,44,"Credit Limit: $",8,60,buffer8,10,CC_REAL,helpf,test,
  4505.               10,44,"Date:",10,49,buffer9,8,CC_ANY,helpf,test,
  4506.               12,44,"Transaction No:",12,60,buffer10,10,CC_DIGIT,helpf,
  4507.                   test};
  4508.  
  4509.           main()
  4510.           {
  4511.           Cls(WHITE_BLACK,CLS_ALL);
  4512.           Fields(WHITE_BLACK,BLACK_WHITE,10,data,F10,F1);
  4513.           }
  4514.  
  4515.           helpf(struct InputFields *p)
  4516.           /*  This function will be called every time the key defined for
  4517.               help is pressed. It is possible to design a context sensitive
  4518.               help facility using this feature */
  4519.           {
  4520.           PushCursor();
  4521.           CursorOff();
  4522.           MessageOn(BLACK_WHITE,"This function will\ndisplay your help
  4523.                                   screens.");
  4524.           WaitTime(200);
  4525.           MessageOff();
  4526.           PopCursor();
  4527.           }
  4528.  
  4529.           test(struct InputFields *p)
  4530.           /*  This function is called every time you exit a field. It can
  4531.               make field validation */
  4532.           {
  4533.           PushCursor();
  4534.           MessageOn(BLACK_WHITE,"This function can perform data
  4535.                   validation\neach time the cursor moves out of the
  4536.                   field.");
  4537.           WaitTime(300);
  4538.           MessageOff();
  4539.           PopCursor();
  4540.           return(1);
  4541.           }
  4542.           NOTE:   The Fields2 function provides a more flexible way to
  4543.                   perform the same task.
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.                     SCL1 Version 3.1 - Reference Manual - Page 73
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.                                                                     Fields2
  4561.           -----------------------------------------------------------------
  4562.                                        Fields2
  4563.           -----------------------------------------------------------------
  4564.  
  4565.           Purpose:    This function lets you integrate various dialog type
  4566.                       functions to design very powerful data entry and
  4567.                       dialog screens. It is similar to Fields but more
  4568.                       flexible. Every field can have its own field check
  4569.                       function which you can create to provide help and
  4570.                       data validation. The screens can contain any of the
  4571.                       following fields:
  4572.  
  4573.                       Line Editor - to enter and edit text and numeric
  4574.                       data.
  4575.  
  4576.                       Scroll Window - to display a window with a list of
  4577.                       items that permits tagging or selecting items.
  4578.  
  4579.                       Mouse Button - a single prompt that permits either to
  4580.                       ignore or activate it.
  4581.  
  4582.                       Tag Item - a field that permits to tag one or various
  4583.                       options.
  4584.  
  4585.                       Select - a field with multiple items for selection.
  4586.  
  4587.                       List Window - similar to the Scroll Window but
  4588.                       permits multiple items in each line.
  4589.  
  4590.                       Calendar - to display a calendar of a given date and
  4591.                       permit the user to modify the date.
  4592.  
  4593.                       User Defined - a field defined by the user.
  4594.  
  4595.           Prototype:  FData2 *Fields2(int Message,FData1 *fd1,FData2 *fd2);
  4596.  
  4597.           Returns:    This function integrates various dialog type
  4598.                       functions.  See Appendix "E" for a description of the
  4599.                       general operation of these functions. Returns a
  4600.                       pointer to the FData2 structure.
  4601.  
  4602.           Parameters: Dialog type functions receive messages and structures
  4603.                       as parameters. The field information is given as an
  4604.                       array of structures type FData1 as follows, one
  4605.                       element for each field:
  4606.  
  4607.           FData1 structure:
  4608.  
  4609.           typedef struct{
  4610.               int FieldType;      The type of function for each field
  4611.                                   defined in SCL1.H as follows:
  4612.  
  4613.                     SCL1 Version 3.1 - Reference Manual - Page 74
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.                                                                     Fields2
  4622.  
  4623.                                   LINE_EDITOR, SCROLL_WINDOW, MOUSE_BUTTON,
  4624.                                   TAG_ITEM SELECT, LIST_WINDOW, CALENDAR or
  4625.                                   USER_DEFINED
  4626.  
  4627.               void *Structure1;   Pointer to a structure that contains all
  4628.                                   the information required for the field.
  4629.  
  4630.               void *Structure2;   Pointer to a second structure that
  4631.                                   contains the field information. Use "0"
  4632.                                   if the field type does not require it.
  4633.  
  4634.               int (* CheckF)();   Pointer to a function, called every time
  4635.                                   an event occurs, that will be responsible
  4636.                                   for the program flow. It will constantly
  4637.                                   receive messages from Fields2 and return
  4638.                                   messages to Fields2 telling it what
  4639.                                   should be done. This allows complete
  4640.                                   control of the behavior of Fields2, as
  4641.                                   well as to perform complex data
  4642.                                   validation, context-sensitive help, etc.
  4643.                                   SCL1 includes a generic CheckF called
  4644.                                   FieldCheck, you should use this function
  4645.                                   even if you create your own CheckF. Refer
  4646.                                   to FieldCheck for more information.
  4647.               }FData1;
  4648.  
  4649.           Fields2 needs a secondary structure type FData2. It is used for
  4650.           communication between Fields2, CheckF and the calling program.
  4651.           Each time an event occurs CheckF is called. By reading the FData2
  4652.           Message element, CheckF knows what has just happened. For
  4653.           example, the user may have pressed the TAB key to move to the
  4654.           next field, or he may have clicked the mouse while pointing at
  4655.           another field, or he may have typed a character. CheckF is
  4656.           responsible of telling Fields2 what should be done.
  4657.  
  4658.           Type FData2 structure:
  4659.  
  4660.           typedef struct{
  4661.               int Message;              Message returned by the active
  4662.                                         field.
  4663.  
  4664.               unsigned int EventInfo;   Information about the keys that
  4665.                                         have been pressed.
  4666.  
  4667.               FData1 *Structure;        Pointer to the FData1 structure.
  4668.  
  4669.               int ActiveField;          Keeps a record of the current
  4670.                                         field, starting with "0" for the
  4671.                                         first field. Used internally by the
  4672.                                         function.
  4673.  
  4674.                     SCL1 Version 3.1 - Reference Manual - Page 75
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.                                                                     Fields2
  4683.  
  4684.               int FieldsNumber;         Holds the number of fields, used
  4685.                                         internally by the function.
  4686.               }FData2;
  4687.  
  4688.           Type structure FData3:
  4689.  
  4690.           typedef struct{
  4691.               int EventInfo;            Information about the last illegal
  4692.                                         or exit key that was pressed.
  4693.  
  4694.               int (* UserField)();      Pointer to the function that will
  4695.                                         handle user defined fieldtype.
  4696.               }FData3;
  4697.  
  4698.           NOTE: The information stored in structure type FData3 is used to
  4699.           define the parameters for user defined fields, please refer to
  4700.           the sample user defined function after the Fields2 example.
  4701.  
  4702.           Messages:
  4703.  
  4704.           The messages that can be sent to the Fields2 function are:
  4705.  
  4706.               F_INIT - initialize the FData2 structure.
  4707.  
  4708.               F_DRAW - draw the Fields2 screen.
  4709.  
  4710.               F_ACTIVE - edit the Fields2 information.
  4711.  
  4712.               F_DRAW_NR - draw the Fields2 display and do not reset the
  4713.               field values. With the F_DRAW message, Fields2 resets all the
  4714.               fields to their starting position.
  4715.  
  4716.               F_COLORS - dialog functions get the colors from their
  4717.               structures. If you have initialized these structures as
  4718.               static data you can change the colors by sending this message
  4719.               to Fields2. It will change the colors in each structure to
  4720.               those specified as additional parameters. The first value
  4721.               passed is the Normal and the second is the Reversed Color.
  4722.  
  4723.               F_ALLOC - after this message is sent, when Fields2 finds a
  4724.               LineEditor type field, it will automatically allocate memory
  4725.               for the buffer.
  4726.  
  4727.               F_FREE - when this message is sent Fields2 will free all
  4728.               buffers allocated for LineEditor type fields.  It is
  4729.               recommended that either allocate all buffers using F_ALLOC or
  4730.               manually but not both.  When this message is sent it will
  4731.               clear all buffers, so be careful.
  4732.  
  4733.  
  4734.  
  4735.                     SCL1 Version 3.1 - Reference Manual - Page 76
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.                                                                     Fields2
  4744.  
  4745.           When the CheckF is called, after determining what should be done,
  4746.           it can send one the following messages back to Fields2:
  4747.  
  4748.               F_MOUSE_EVENT - When the mouse is clicked outside the active
  4749.               field FieldCheck will receive a LE_MOUSE_EVENT (SW_ or LW_
  4750.               etc.) and FieldCheck should return a F_MOUSE_EVENT message to
  4751.               Fields2. Fields2 will then give control to the field (if any)
  4752.               that can handle the mouse event.
  4753.  
  4754.               F_POSITION_STAY - instructs Fields2 not to move to other
  4755.               field. It is useful when the field does not pass the
  4756.               validation check, to permit the user to edit its contents.
  4757.  
  4758.               F_POSITION_UP - move to the next field.
  4759.  
  4760.               F_POSITION_DOWN - move to the previous field.
  4761.  
  4762.               F_SET_POSITION - move the cursor to a desired field. You must
  4763.               first set the ActiveField structure member to the desired
  4764.               field number and then return this message.
  4765.  
  4766.               F_EXIT - instructs Fields2 to exit.
  4767.  
  4768.               F_SET_POS_EXIT - exit after setting a predetermined position.
  4769.  
  4770.               F_CHECK_ALL - when a CheckF senses an exit condition, it
  4771.               sends this message to Fields2 who will call any CheckF
  4772.               defined for each field. By returning this message you can be
  4773.               sure that the data in each field is valid, since Fields2 will
  4774.               move to any field that do not pass the CheckF validation. If
  4775.               all Fields are valid it will behave as an F_EXIT message.
  4776.  
  4777.               F_FIELDSTART - when the cursor is located in one valid field
  4778.               this message will be sent to the FieldCheck function.
  4779.  
  4780.               F_START - This message is sent to the FieldCheck function (in
  4781.               the FData2 Message element) when Fields2 first receives the
  4782.               F_ACTIVE message. You can use this message to initialize or
  4783.               modify any condition before the user gets control.
  4784.  
  4785.           Due to the function integrating purpose of Fields2, it does not
  4786.           return messages.
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.                     SCL1 Version 3.1 - Reference Manual - Page 77
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.                                                                     Fields2
  4805.  
  4806.           Example:
  4807.  
  4808.           #include <string.h>
  4809.           #include <scl1.h>
  4810.           #include <scl1keys.h>
  4811.           #include <scl1clor.h>
  4812.  
  4813.           /*  Shows the use of the Fields2 and FieldCheck functions and how
  4814.               to create an user defined field check function.
  4815.  
  4816.               The data entry field has a Select type field, one LineEditor
  4817.               and two mouse buttons.
  4818.  
  4819.               The field check function will:
  4820.  
  4821.                   1)  Check for F1 key to display context sensitive help.
  4822.                   2)  Check if user has selected YES or NO. The LineEditor
  4823.                       field color is grayed in the case of NO.
  4824.                   3)  Keep the cursor off the LineEditor field if the user
  4825.                       has selected NO and the LineEditor field is grayed
  4826.                       out.
  4827.                   4)  Check before exit if cancel is not selected and YES
  4828.                       has been selected if the user has fill out the
  4829.                       LineEditor field.  */
  4830.  
  4831.           int OurFieldCheck(FData2 *fd2);  /* our CheckF prototype */
  4832.  
  4833.           int Color1=WHITE_BLUE;           /* Colors are initialized */
  4834.           int Color2=BLACK_CYAN;           /* for a color monitor */
  4835.           int Color3=BROWN_BLACK+HIGHLIGHT;
  4836.  
  4837.           /* Our first field will be a Select type */
  4838.  
  4839.           SData1 sd1[]={             /* This is Select's first structure */
  4840.               11,37,"YES",
  4841.               11,47,"NO",
  4842.               0};
  4843.  
  4844.           /* Select's secondary structure: */
  4845.  
  4846.           SData2 sd2={23,11,16,"Create backup files:",0,0,0,0};
  4847.  
  4848.           /*  Our second field will be a LineEditor type. This structure
  4849.               defines the LineEditor configuration */
  4850.  
  4851.           LEData led={23,13,16,"Backup Directory:",112,13,34,30,30,
  4852.                   CC_PATH+CC_CAPITALIZE, 0,0,0,0,0,0,2,1,0,0,0,0,0,0,0};
  4853.  
  4854.  
  4855.  
  4856.  
  4857.                     SCL1 Version 3.1 - Reference Manual - Page 78
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.                                                                     Fields2
  4866.  
  4867.           /* The next two fields will be of the MouseButton type. */
  4868.  
  4869.           MBData mb1={23,112,15,28,15,33,15,28,"≡ OK ≡",0,0,0,0};
  4870.  
  4871.           MBData mb2={23,112,15,42,15,51,15,42,"≡ CANCEL ≡",0,0,0,0};
  4872.  
  4873.           FData1 fd1[]={   /* This is the FData1 structure: */
  4874.               SELECT,sd1,&sd2,OurFieldCheck,
  4875.               LINE_EDITOR,&led,0,OurFieldCheck,
  4876.               MOUSE_BUTTON,&mb1,0,OurFieldCheck,
  4877.               MOUSE_BUTTON,&mb2,0,OurFieldCheck,
  4878.               0};
  4879.  
  4880.           char F1Text[]=" Press F1 for Help ";
  4881.  
  4882.           main()
  4883.           {
  4884.           FData2 fd2;    /* Fields2 secondary structure */
  4885.  
  4886.           if(Video()==MONO)    /* Verify the type of display and change */
  4887.               {                /* colors if necessary */
  4888.               Color1=WHITE_BLACK;
  4889.               Color2=BLACK_WHITE;
  4890.               Color3=BLACK_WHITE+HIGHLIGHT;
  4891.               }
  4892.  
  4893.           /* Clear the screen and draw a box */
  4894.  
  4895.           Cls(Color1,10,13,16,66);
  4896.           Box(Color1,0,10,13,16,66);
  4897.  
  4898.           WriteScreen(Color1,16,Center(F1Text),F1Text);
  4899.  
  4900.           /* Call Fields2 with a F_INIT message */
  4901.  
  4902.           Fields2(F_INIT,fd1,&fd2);
  4903.  
  4904.           /* allocate buffer for LineEditor field */
  4905.  
  4906.           Fields2(F_ALLOC,fd1,&fd2);
  4907.  
  4908.           /* Tell Fields2 to modify colors to new values */
  4909.  
  4910.           Fields2(F_COLORS,fd1,&fd2,Color1,Color2);
  4911.  
  4912.           /* Draw fields */
  4913.  
  4914.           Fields2(F_DRAW,fd1,&fd2);
  4915.  
  4916.           InitMouse(IM_SHOW);
  4917.  
  4918.                     SCL1 Version 3.1 - Reference Manual - Page 79
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.                                                                     Fields2
  4927.  
  4928.           /* Activate, now our CheckF will be in control of program flow */
  4929.  
  4930.           Fields2(F_ACTIVE,fd1,&fd2);
  4931.  
  4932.           /*  Check the FData2 structure to see if the user presses ESCAPE
  4933.               or selects the CANCEL mouse button for exiting */
  4934.  
  4935.           if(fd2.ActiveField==3 || fd2.EventInfo==ESC)
  4936.  
  4937.               exit(-1);   /* CANCEL selected */
  4938.           else
  4939.               exit(0);    /* OK selected */
  4940.           }
  4941.  
  4942.           /* This is the custom field check function */
  4943.  
  4944.           int OurFieldCheck(FData2 *fd2)
  4945.           {
  4946.           int Mess;
  4947.  
  4948.           /* Let SCL1 FieldCheck function do most of the work */
  4949.  
  4950.           Mess=FieldCheck(fd2);
  4951.  
  4952.           /*  1)  We will watch the F1 help key. It will be reported by
  4953.                   Fields2 with an ILLEGAL_KEY message in the FData2
  4954.                   EventInfo structure element.*/
  4955.  
  4956.           if(fd2->Message == LE_ILLEGAL_KEY && fd2->EventInfo==F1)
  4957.               {
  4958.  
  4959.               /* display help, fd2->ActiveField = active field number */
  4960.  
  4961.               Help(fd2->ActiveField);
  4962.  
  4963.               /*  return POSITION_STAY message so that the cursor is not
  4964.                   moved to another field */
  4965.  
  4966.               Mess=F_POSITION_STAY;
  4967.               }
  4968.  
  4969.           /*  2)  Check if the Select field is active and if a
  4970.                   S_NEW_POSITION message, was send by Select. This message
  4971.                   is received each time the user changes his selection.
  4972.                   We'll check current position to validate or invalidate
  4973.                   the LineEditor field */
  4974.  
  4975.           else if(fd2->ActiveField==0 && fd2->Message==S_NEW_POSITION)
  4976.               {
  4977.               if(sd2.Position==0)       /* YES selected */
  4978.  
  4979.                     SCL1 Version 3.1 - Reference Manual - Page 80
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.                                                                     Fields2
  4988.  
  4989.                   {
  4990.                   led.PColor=Color1;
  4991.                   led.FColor=Color2;    /* normal colors */
  4992.                   }
  4993.               else
  4994.  
  4995.               /* NO selected, use gray color */
  4996.  
  4997.                   {
  4998.                   led.PColor=BLACK_BLUE + HIGHLIGHT;
  4999.                   led.FColor=BLACK_BLACK + HIGHLIGHT;
  5000.                   }
  5001.  
  5002.               LineEditor(LE_DRAW,&led); /* redraw LineEditor */
  5003.               }
  5004.  
  5005.           /*  3)  The FIELDSTART message is send each time a new field
  5006.                   receives control.  We'll check this message and if the
  5007.                   LineEditor field is active we'll check its color. If it
  5008.                   is set to gray color it means that the user has selected
  5009.                   not to create backup files. In this case we'll move to
  5010.                   the next or previous field. By checking fd2->EventInfo
  5011.                   we'll know if the user had previously pressed TAB (for
  5012.                   the next field) or SHIFT+TAB */
  5013.  
  5014.           else if(fd2->ActiveField==1 && fd2->Message==F_FIELDSTART)
  5015.               {
  5016.               if(led.FColor==BLACK_BLACK + HIGHLIGHT)
  5017.                   {
  5018.                   if(fd2->EventInfo==TAB)
  5019.                       fd2->ActiveField=2;     /* next field */
  5020.                   else
  5021.                       fd2->ActiveField=0;     /* previous field */
  5022.                   Mess=F_SET_POSITION;
  5023.                   }
  5024.               }
  5025.  
  5026.           /*  4)  When the user wants to exit we'll check if a string has
  5027.                   been entered in the LineEditor field if Select is set to
  5028.                   YES and the OK mouse button was selected. We know we are
  5029.                   about to exit fields when FieldCheck returns and F_EXIT
  5030.                   message. We'll also check if the key that was used to
  5031.                   exit was ESCAPE or the CANCEL button was selected, in
  5032.                   these cases the user has selected to cancel the
  5033.                   operation. */
  5034.  
  5035.           else if(Mess==F_EXIT && fd2->EventInfo != ESC && fd2->ActiveField
  5036.           != 3)
  5037.               {
  5038.  
  5039.  
  5040.                     SCL1 Version 3.1 - Reference Manual - Page 81
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048.                                                                     Fields2
  5049.  
  5050.           /*  if Select is in YES position and no directory has been
  5051.               entered */
  5052.  
  5053.               if(sd2.Position==0 && strlen(led.Buffer)==0)
  5054.                   {
  5055.  
  5056.                   /*  display error, change message to POSITION_STAY and
  5057.                       move the cursor to the LineEditor field */
  5058.  
  5059.                   MessageOn(Color3,"Directory must be entered!");
  5060.                   Mess=F_POSITION_STAY;
  5061.                   fd2->ActiveField=1;
  5062.                   WaitKeyMouse();
  5063.                   MessageOff();
  5064.                   }
  5065.               }
  5066.  
  5067.           /*  Mess holds the message Fields2 will receive, a POSITION_STAY
  5068.               message or the message returned by FieldCheck */
  5069.  
  5070.           return(Mess);
  5071.           }
  5072.  
  5073.           char AllHelp[]=" TAB-next  SHIFT TAB-previous ";
  5074.  
  5075.           Help(int field)
  5076.           {
  5077.  
  5078.           /* save cursor status and turn it off */
  5079.  
  5080.           PushCursor();
  5081.           CursorOff();
  5082.  
  5083.           /*  field tells us the field number that is active, we will use
  5084.               it to display context sensitive help */
  5085.  
  5086.           switch(field)
  5087.               {
  5088.               case 0: /* first field */
  5089.  
  5090.                   MessageOn(Color3,"Use arrow keys to select if you\nwant
  5091.                             to create backup files.");
  5092.                   break;
  5093.  
  5094.               case 1: /* second field */
  5095.  
  5096.                   MessageOn(Color3,"Type Backup files directory.");
  5097.                   break;
  5098.  
  5099.  
  5100.  
  5101.                     SCL1 Version 3.1 - Reference Manual - Page 82
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.                                                                     Fields2
  5110.  
  5111.               case 2: /* third field */
  5112.  
  5113.                   MessageOn(Color3,"Press ENTER to validate\nyour
  5114.                             selection.");
  5115.                   break;
  5116.  
  5117.               case 3: /* fourth field */
  5118.  
  5119.                   MessageOn(Color3,"Press ENTER or ESC to\ncancel your
  5120.                             selection.");
  5121.                   break;
  5122.               }
  5123.  
  5124.           WriteScreen(Color3,12,Center(AllHelp),AllHelp);
  5125.  
  5126.           /* wait for mouse or keystroke, remove message, restore cursor */
  5127.  
  5128.           WaitKeyMouse();
  5129.           MessageOff();
  5130.           PopCursor();
  5131.           }
  5132.  
  5133.  
  5134.           /****************************************************************
  5135.               This example shows how to create an user defined field type
  5136.               to use with the Fields2 function.
  5137.  
  5138.               We will create a field that displays one of several
  5139.               predefined strings. The user can select one by using the UP
  5140.               and DOWN arrow keys or by clicking the mouse after pointing
  5141.               at  any of the two small arrows. To create an user defined
  5142.               field we need to create the function that will handle the new
  5143.               field type.  This function must be written with the following
  5144.               requirements:
  5145.  
  5146.               1)  The function must be capable of receiving and handling
  5147.                   the following messages:
  5148.  
  5149.                   Message         Action
  5150.  
  5151.                   RESET        -  Reset all internal variables to start-up
  5152.                                   conditions.
  5153.  
  5154.                   DRAW         -  Draw the field to the screen.
  5155.  
  5156.                   ACTIVE       -  Get user input.
  5157.  
  5158.                   CHECK_MOUSE  -  Check if a mouse event has occurred
  5159.                                   inside the field area.
  5160.  
  5161.  
  5162.                     SCL1 Version 3.1 - Reference Manual - Page 83
  5163.  
  5164.  
  5165.  
  5166.  
  5167.  
  5168.  
  5169.  
  5170.                                                                     Fields2
  5171.  
  5172.               2)  The function must return the following messages to
  5173.                   Fields2:
  5174.  
  5175.                   Message         Action
  5176.  
  5177.                   OK           -  Action requested was successfully
  5178.                                   performed.
  5179.  
  5180.                   EXIT_KEY     -  A key defined as an exit key was pressed.
  5181.  
  5182.                   ILLEGAL_KEY  -  An unknown key was pressed.
  5183.  
  5184.                   MOUSE_EVENT  -  A mouse event not related to this
  5185.                                   function has occurred.
  5186.  
  5187.                   MY_MOUSE     -  A CHECK_MOUSE message is answered with
  5188.                                   this message if the mouse event is
  5189.                                   related to this function. Fields will
  5190.                                   give control to this function when a
  5191.                                   MY_MOUSE event is returned.
  5192.  
  5193.                   NEW_POSITION -  the user has moved to a new position or
  5194.                                   selected a new element. (This one is not
  5195.                                   required but it is highly recommended).
  5196.  
  5197.               3)  All local data (color, position, etc.) must be stored in
  5198.                   a structure.  A pointer to this structure will be passed
  5199.                   as a parameter whenever the function is called. Look at
  5200.                   any SCL1 dialog function for an example. The use of a
  5201.                   structure to hold local data makes possible for a single
  5202.                   LineEditor structure to handle all LineEditor fields in a
  5203.                   data-entry screen.
  5204.  
  5205.               4)  The following parameters are passed each time the
  5206.                   function is called:
  5207.  
  5208.                   Message (int)   any of the messages described above.
  5209.  
  5210.                   st (void *)     pointer to the field related structure.
  5211.  
  5212.                   fd3 (FData3 *)  pointer to a FData3 structure that has
  5213.                                   the following format:
  5214.  
  5215.                   typedef struct{
  5216.                          int EventInfo;
  5217.                          int (* cdecl UserField)();
  5218.                          }FData3;
  5219.  
  5220.               5)  When called the function must:
  5221.  
  5222.  
  5223.                     SCL1 Version 3.1 - Reference Manual - Page 84
  5224.  
  5225.  
  5226.  
  5227.  
  5228.  
  5229.  
  5230.  
  5231.                                                                     Fields2
  5232.  
  5233.                   a)  Service the message received.
  5234.  
  5235.                   b)  If an illegal or exit key is detected it should copy
  5236.                       the key's SCAN/ASCII code to the EventInfo element of
  5237.                       the FData3 struct.
  5238.  
  5239.                   c)  Return the correct message.
  5240.  
  5241.               Before calling Fields2 you must properly initialize the user
  5242.               defined and the FData3 structure. In the case of FData3 only
  5243.               the UserField element needs to be initialized (points to the
  5244.               function that will handle the user defined field type).
  5245.           ****************************************************************/
  5246.  
  5247.           #include <scl1.h>
  5248.           #include <scl1keys.h>
  5249.  
  5250.           /* function prototype of our new field handler */
  5251.  
  5252.           int SelectString(int Message,void *st,FData3 *fd3);
  5253.  
  5254.               /* new field data */
  5255.  
  5256.           char *MyText[]={
  5257.               "111111111111111111",
  5258.               "222222222222222222",
  5259.               "333333333333333333",
  5260.               0,
  5261.               };
  5262.  
  5263.           typedef struct{   /* our new field structure */
  5264.               int Color;
  5265.               int Row;
  5266.               int Col;
  5267.               int Position;
  5268.               int Items;
  5269.               int Length;
  5270.               char **Text;
  5271.               }SSData;
  5272.  
  5273.               /* initialize our field structure */
  5274.  
  5275.           SSData ssd={7,7,13,0,3,0,MyText};
  5276.  
  5277.               /* a mouse button structure */
  5278.  
  5279.           MBData mb={7,112,9,13,9,18,9,13,"< OK >",0,0,0,0};
  5280.  
  5281.  
  5282.  
  5283.  
  5284.                     SCL1 Version 3.1 - Reference Manual - Page 85
  5285.  
  5286.  
  5287.  
  5288.  
  5289.  
  5290.  
  5291.  
  5292.                                                                     Fields2
  5293.  
  5294.           /*  It is very important to initialize our FData3 structure so
  5295.               that the UserField element points to the function that
  5296.               handles the new field type */
  5297.  
  5298.           FData3 ssfd3={0,SelectString};
  5299.  
  5300.               /* FData1 struct */
  5301.  
  5302.           FData1 fd1[]={
  5303.  
  5304.               /*  First field is our used defined field, the SSData pointer
  5305.                   is used as Structure1 element and the FData3 pointer as
  5306.                   Structure2 element.
  5307.  
  5308.               We will use SCL1's default FieldCheck function */
  5309.  
  5310.               USER_DEFINED,&ssd,&ssfd3,FieldCheck,
  5311.               MOUSE_BUTTON,&mb,0,FieldCheck,
  5312.               0};
  5313.  
  5314.           main()
  5315.           {
  5316.           FData2 fd2;
  5317.  
  5318.           Cls(7,CLS_ALL);                  /* Clear screen */
  5319.           InitMouse(IM_SHOW);              /* initialize mouse */
  5320.           Fields2(F_INIT,fd1,&fd2);        /* init fields */
  5321.           Fields2(F_DRAW,fd1,&fd2);        /* draw */
  5322.           Fields2(F_ACTIVE,fd1,&fd2);      /* give control */
  5323.           }
  5324.  
  5325.           /*  our new field type. Here we'll send received messages for
  5326.               processing */
  5327.  
  5328.           int SelectString(int Message,void *st,FData3 *fd3)
  5329.           {
  5330.           SSData *ssd;
  5331.  
  5332.           ssd=(SSData *)st;
  5333.  
  5334.               /*  You could define any messages for your field, but the
  5335.                   value assigned to each message must equal those assigned
  5336.                   to regular dialog functions. In this example we will use
  5337.                   LineEditor messages */
  5338.  
  5339.           switch(Message)
  5340.               {
  5341.               case LE_DRAW:
  5342.                   DrawUF(ssd);
  5343.                   return(LE_OK);
  5344.  
  5345.                     SCL1 Version 3.1 - Reference Manual - Page 86
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.                                                                     Fields2
  5354.  
  5355.               case LE_ACTIVE:
  5356.                   return(ActiveUF(ssd,fd3));
  5357.               case LE_CHECK_MOUSE:
  5358.                   return(CheckUFMouse(ssd,fd3));
  5359.               case LE_RESET:
  5360.                   ssd->Position=0;      /* reset position to 0 */
  5361.                   return(LE_OK);
  5362.               }
  5363.           return(LE_OK);
  5364.           }
  5365.  
  5366.           /*  Draws our field to the screen and initializes several
  5367.               elements of our structure */
  5368.  
  5369.           int DrawUF(SSData *ssd)
  5370.           {
  5371.           int i=0,j,maxlength=0;
  5372.  
  5373.           while(ssd->Text[i] != 0)      /* count the number of items */
  5374.               {
  5375.               j=strlen(ssd->Text[i]);   /* save the largest element size */
  5376.               if(j > maxlength)
  5377.                   maxlength=j;
  5378.               ++i;
  5379.               }
  5380.           ssd->Items=i;                 /* save in struct */
  5381.           ssd->Length=maxlength;
  5382.  
  5383.               /* write string */
  5384.  
  5385.           WriteScreenLen(ssd->Color,ssd->Row,ssd->Col+2,maxlength,ssd->Text
  5386.                          [ssd->Position]);
  5387.  
  5388.               /* draw up and down arrows */
  5389.  
  5390.           WriteChar(ssd->Color,ssd->Row,ssd->Col,1,24);
  5391.           WriteChar(ssd->Color,ssd->Row,ssd->Col+maxlength+3,1,25);
  5392.           }
  5393.  
  5394.               /* This functions is called when our field is active */
  5395.  
  5396.           ActiveUF(SSData *ssd,FData3 *fd3)
  5397.           {
  5398.           unsigned int key;
  5399.  
  5400.           SetCurPos(ssd->Row,ssd->Col+2);  /* position cursor */
  5401.           do
  5402.               {
  5403.               if(MSE_LPress)               /* mouse event? */
  5404.                   {
  5405.  
  5406.                     SCL1 Version 3.1 - Reference Manual - Page 87
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.                                                                     Fields2
  5415.  
  5416.                   if(CheckUFMouse(ssd)==LE_MY_MOUSE)   /* our mouse? */
  5417.                       {        /* clicked at the up arrow key */
  5418.                       if(MSE_LpX==ssd->Col)
  5419.                          {
  5420.                          WaitTime(25);
  5421.                          goto UpKey;
  5422.                          }
  5423.  
  5424.                                /* clicked at the down arrow key */
  5425.  
  5426.                       else if(MSE_LpX==ssd->Col+ssd->Length+3)
  5427.                          {
  5428.                          WaitTime(25);
  5429.                          goto DownKey;
  5430.                          }
  5431.                       }
  5432.  
  5433.                   else
  5434.  
  5435.                                /* clicked outside our area, return a
  5436.                                   MOUSE_EVENT message */
  5437.  
  5438.                       return(LE_MOUSE_EVENT);
  5439.                   }
  5440.  
  5441.               if(KeyReady())      /* check keystrokes */
  5442.                   {
  5443.                   key=GetKey();
  5444.                   switch(key)
  5445.                       {
  5446.                       case UP:
  5447.           UpKey:
  5448.                          if(ssd->Position > 0)
  5449.                             --ssd->Position;  /* change position */
  5450.                          else
  5451.                             ssd->Position=ssd->Items-1;
  5452.                          DrawUF(ssd);         /* update screen */
  5453.                          return(LE_NEW_POSITION);
  5454.                       case DOWN:
  5455.           DownKey:
  5456.                          if(ssd->Position + 1 < ssd->Items)
  5457.  
  5458.                             ++ssd->Position;  /* change position */
  5459.                          else
  5460.                             ssd->Position=0;
  5461.                          DrawUF(ssd);         /* update screen */
  5462.                          return(LE_NEW_POSITION);
  5463.                       case TAB:
  5464.                       case SHIFTTAB:          /* handle exit keys */
  5465.  
  5466.  
  5467.                     SCL1 Version 3.1 - Reference Manual - Page 88
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.                                                                     Fields2
  5476.  
  5477.                       case ESC:
  5478.                          fd3->EventInfo=key;  /* save key value */
  5479.                          return(LE_EXIT_KEY);
  5480.                       default:                /* handle unknown keys */
  5481.                          fd3->EventInfo=key;  /* save key value */
  5482.                          return(LE_ILLEGAL_KEY);
  5483.                       }
  5484.                   }
  5485.               }while(1);
  5486.           }
  5487.  
  5488.  
  5489.               /*  This function checks if the mouse has been clicked in our
  5490.                   area */
  5491.  
  5492.           CheckUFMouse(SSData *ssd)
  5493.           {
  5494.           if(MSE_LpY==ssd->Row && MSE_LpX >= ssd->Col && MSE_LpX <=
  5495.           ssd->Col+ssd->Length+3)
  5496.  
  5497.               /* return MY_MOUSE if YES */
  5498.  
  5499.               return(LE_MY_MOUSE);
  5500.  
  5501.           else
  5502.               return(LE_MOUSE_EVENT);
  5503.           }
  5504.  
  5505.  
  5506.  
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.                     SCL1 Version 3.1 - Reference Manual - Page 89
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.                                                                     FileBox
  5537.           -----------------------------------------------------------------
  5538.                                        FileBox
  5539.           -----------------------------------------------------------------
  5540.  
  5541.           Purpose:    Displays a box with the directory information for
  5542.                       loading or selecting files with the keyboard or
  5543.                       mouse. Fills a buffer with the selected file/path.
  5544.                       You can change the MouseButton and prompt text with
  5545.                       the FB_SetUserLang function.
  5546.  
  5547.           Prototype:  int FileBox(int NColor, int RColor,char *Buffer);
  5548.  
  5549.           Returns:    Returns "-1" if the operation is canceled by the user
  5550.                       by pressing ESC or selecting the cancel option, or
  5551.                       "0" if there are no problems.
  5552.  
  5553.           Parameters:
  5554.  
  5555.               NColor - color attributes for normal color display (int).
  5556.  
  5557.               RColor - color attributes for reverse color display (int).
  5558.  
  5559.               Buffer - char pointer to the buffer that will hold the
  5560.               selected filename. The search string is placed in the buffer
  5561.               before calling the function. If an empty buffer is used (NO
  5562.               SEARCH STRING SPECIFIED), the function will place the default
  5563.               path and the "*.*" search string into it. This buffer must be
  5564.               of size FB_BUF_SIZE as defined in SCL1.H.
  5565.  
  5566.           Example:
  5567.  
  5568.           #include <scl1.h>
  5569.           #include <scl1clor.h>
  5570.  
  5571.           int Color1=BLACK_WHITE;
  5572.           int Color2=WHITE_BLACK;
  5573.  
  5574.           char FileBuf[FB_BUF_SIZE]; /* Buffer big enough so that the
  5575.                                         directory information will fit */
  5576.           main()
  5577.           {
  5578.           FileBox(Color1,Color2,FileBuf);
  5579.           WriteScreen(Color1,20,12,"You have Selected:");
  5580.           WriteScreen(Color1,20,33,FileBuf);
  5581.           }
  5582.  
  5583.           See also FileBox2, FileBox3 and WfileBox.
  5584.  
  5585.  
  5586.  
  5587.  
  5588.  
  5589.                     SCL1 Version 3.1 - Reference Manual - Page 90
  5590.  
  5591.  
  5592.  
  5593.  
  5594.  
  5595.  
  5596.  
  5597.                                              FileBox2 - FileBox3 - WFileBox
  5598.           -----------------------------------------------------------------
  5599.                              FileBox2, FileBox3, WFileBox
  5600.           -----------------------------------------------------------------
  5601.  
  5602.           Purpose:    FileBox2 displays a box with for selecting files
  5603.                       using the keyboard or mouse. Fills a buffer with the
  5604.                       selected file/path. Displays the action MouseButtons
  5605.                       at the right of the box. You can change the
  5606.                       MouseButton and prompt text with the FB_SetUserLang
  5607.                       function. FileBox3 can also display the file's size,
  5608.                       date, time and attributes. Files can be sorted by
  5609.                       name, extension, size, date, time or attribute. You
  5610.                       can change the prompts and MouseButton text using the
  5611.                       FB3_SetUserLang function. WFileBox is similar to
  5612.                       FileBox2 but uses a full screen. You can use
  5613.                       WF_SetUserLang to change the Mouse Button prompts.
  5614.  
  5615.           Prototype:  int FileBox2(int Message, FBData *p)
  5616.  
  5617.                       int FileBox3(int Message, FB3Data *fb3)
  5618.  
  5619.                       int WFileBox(int Message, FBData *p)
  5620.  
  5621.           Returns:    This is a dialog derived function. See Appendix "E"
  5622.                       for a description of the general operation of these
  5623.                       functions. Returns the messages described in the
  5624.                       Messages section.
  5625.  
  5626.           Parameters: The file box information is given in a structure type
  5627.                       FBData (for FileBox2 and WFileBox) or FB3Data (for
  5628.                       FileBox3) as follows:
  5629.  
  5630.           Structure type FBData;  (Used with FileBox2 and WFileBox)
  5631.  
  5632.           typedef struct{
  5633.               int NColor;         Normal color for the file box display.
  5634.  
  5635.               int RColor;         Reversed color for the file box display.
  5636.  
  5637.               int UpperRow;       Upper row position for the file box.
  5638.  
  5639.               int LeftCol;        Left column position for the file box.
  5640.  
  5641.               int LowerRow;       Lower row position for the file box.
  5642.  
  5643.               int RightCol;       Right column position for the file box.
  5644.  
  5645.  
  5646.  
  5647.  
  5648.  
  5649.  
  5650.                     SCL1 Version 3.1 - Reference Manual - Page 91
  5651.  
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.                                              FileBox2 - FileBox3 - WFileBox
  5659.  
  5660.               char *Filename;     Char pointer to the buffer that will hold
  5661.                                   the selected filename. The search string
  5662.                                   is placed in the buffer before calling
  5663.                                   the function. If an empty buffer is used,
  5664.                                   the function will place the default path
  5665.                                   and the "*.*" search string in the
  5666.                                   buffer. It must be of size FB_BUF_SIZE as
  5667.                                   defined in SCL1.H.
  5668.  
  5669.               int Attrib;         File attributes as defined by the DOS.
  5670.                                   Refer to Appendix "A" for more details.
  5671.               }FBData;
  5672.  
  5673.           Structure type FB3Data;
  5674.  
  5675.           typedef struct{
  5676.               int NColor;      See description for FBData structure above.
  5677.               int RColor;               "                        "
  5678.               int UpperRow;             "                        "
  5679.               int LeftCol;              "                        "
  5680.               int LowerRow;             "                        "
  5681.               int RightCol;             "                        "
  5682.               char *Filename;           "                        "
  5683.               int Attrib;               "                        "
  5684.  
  5685.               unsigned int Display;  Variable used to specify what to show
  5686.                                      in the FileBox display. The following
  5687.                                      constants can be used in this
  5688.                                      specification:
  5689.  
  5690.                                      FB_NAME - show name.
  5691.                                      FB_SIZE - show size.
  5692.                                      FB_DATE - show date.
  5693.                                      FB_TIME - show time.
  5694.                                      FB_ATTRIB - show attributes.
  5695.                                      FB_DMY - show date using the Day-
  5696.                                      Month-Year format.
  5697.                                      FB_YMD - show date using the Year-
  5698.                                      Month-Day format.
  5699.  
  5700.                                      They can be concatenated (added) to
  5701.                                      specify various options,as in:
  5702.  
  5703.                                      FB_NAME + FB_SIZE + FB_DATE + FB_TIME
  5704.                                      + FB_ATTRIB
  5705.  
  5706.               unsigned int SortType; Variable used to define the desired
  5707.                                      sorting order of the files. The
  5708.                                      following constants can used in this
  5709.                                      specification:
  5710.  
  5711.                     SCL1 Version 3.1 - Reference Manual - Page 92
  5712.  
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.                                              FileBox2 - FileBox3 - WFileBox
  5720.  
  5721.                                      FB_NAME - sort by name
  5722.                                      FB_EXT - sort by extension
  5723.                                      FB_DATE - sort by date
  5724.                                      FB_ATTRIB - sort by attribute
  5725.  
  5726.                                      The following constants can be used to
  5727.                                      specify the sorting action:
  5728.  
  5729.                                      FB_REVERSE - sort in reverse order
  5730.                                      FB_DIR_FIRST - place the directories
  5731.                                      before the files.
  5732.  
  5733.               int FileNumber;        Number of files found.
  5734.  
  5735.               int DirNumber;         Number of directories found.
  5736.               }FB3Data;
  5737.  
  5738.           Messages:
  5739.  
  5740.           The following messages can be sent to FileBox2, FileBox3 and
  5741.           WFileBox:
  5742.  
  5743.               FB_INIT - initialize the FBData or FB3Data structure to NULL
  5744.               and set the following default values:
  5745.  
  5746.                   NColor - set to white characters in a black background or
  5747.                   the normal color set by SetDialogColors.
  5748.  
  5749.                   RColor -  set to black characters in a white background
  5750.                   or the reversed color set by SetDialogColors.
  5751.  
  5752.                   UpperRow, LeftCol, LowerRow and RightCol - set to display
  5753.                   the FileBox centered in the screen.
  5754.  
  5755.                   Attrib - files and sub-directories.
  5756.  
  5757.               For FB3Data only;
  5758.  
  5759.                   Display - set to show the file name, size, date, time and
  5760.                   attributes. The date is displayed in the Month-Day-Year
  5761.                   format.
  5762.  
  5763.                   SortType - set to sort the files by name.
  5764.  
  5765.               FB_DRAW - draw the FileBox to the screen.
  5766.  
  5767.               FB_ACTIVE - browse through the displayed filenames and permit
  5768.               a selection or to cancel the operation using the cursor
  5769.               movement keys as follows:
  5770.  
  5771.  
  5772.                     SCL1 Version 3.1 - Reference Manual - Page 93
  5773.  
  5774.  
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.                                              FileBox2 - FileBox3 - WFileBox
  5781.  
  5782.                          Key            Action
  5783.  
  5784.                       Up Arrow       one item up.
  5785.                       Down Arrow     one item down.
  5786.                       END            end of file list.
  5787.                       HOME           beginning of list.
  5788.                       Page Up        one screen up.
  5789.                       Page Down      one screen down.
  5790.  
  5791.               FB_RESET - when this message is sent the filebox variables
  5792.               are reset to the default value.
  5793.  
  5794.           The following messages can be returned by FileBox2, FileBox3 and
  5795.           WFileBox:
  5796.  
  5797.               FB_OK - the action requested has been performed and a file
  5798.               has been selected.
  5799.  
  5800.               FB_CANCEL - the operation has been canceled.
  5801.  
  5802.           For FileBox3 only;
  5803.  
  5804.               FB_NO_MEM - there is not enough memory left to perform the
  5805.               requested action.
  5806.  
  5807.               FB_ILLEGAL_OP - you have specified an illegal option.
  5808.  
  5809.           Example:
  5810.  
  5811.           #include <scl1.h>
  5812.           #include <scl1clor.H>
  5813.  
  5814.               /* Shows the use of filebox functions */
  5815.  
  5816.           main()
  5817.           {
  5818.           char Buffer[FB_BUF_SIZE];
  5819.           FBData fb2;
  5820.           FB3Data fb3;
  5821.           FBData fbw;
  5822.  
  5823.           memset(Buffer,0,sizeof(Buffer));
  5824.           InitMouse(IM_SHOW);
  5825.  
  5826.           FileBox2(FB_INIT,&fb2);    /* initialize the FBData structure */
  5827.  
  5828.           WFileBox(FB_INIT,&fbw);    /* initialize the FBData structure */
  5829.  
  5830.           FileBox3(FB_INIT,&fb3);    /* initialize the FB3Data structure */
  5831.  
  5832.  
  5833.                     SCL1 Version 3.1 - Reference Manual - Page 94
  5834.  
  5835.  
  5836.  
  5837.  
  5838.  
  5839.  
  5840.  
  5841.                                              FileBox2 - FileBox3 - WFileBox
  5842.  
  5843.           fb2.NColor=fb3.NColor=fbw.NColor=WHITE_BLACK;/* change display
  5844.                                                           colors */
  5845.  
  5846.           fb2.RColor=fb3.RColor=fbw.RColor= BLACK_WHITE;
  5847.           fb2.Filename=fb3.Filename=fbw.Filename=Buffer; /* buffer to hold
  5848.                                                             dir info */
  5849.  
  5850.               /* set files attributes */
  5851.  
  5852.           fb2.Attrib=fb3.Attrib=fbw.Attrib=F_READ_ONLY+F_HIDDEN+F_SYSTEM+
  5853.                       F_DIRECTORY;
  5854.  
  5855.           FileBox2(FB_DRAW,&fb2);       /* display FileBox */
  5856.  
  5857.           FileBox2(FB_ACTIVE,&fb2);     /* let user make a selection */
  5858.  
  5859.           /* sort by name and place directories first in the list */
  5860.  
  5861.           fb3.SortType=FB_NAME+FB_DIR_FIRST;
  5862.  
  5863.           FileBox3(FB_DRAW,&fb3);       /* display FileBox */
  5864.           FileBox3(FB_ACTIVE,&fb3);     /* let user make a selection */
  5865.  
  5866.           WFileBox(FB_DRAW,&fbw);       /* display Wide FileBox */
  5867.           WFileBox(FB_ACTIVE,&fbw);     /* let user make a selection */
  5868.           }
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.  
  5885.  
  5886.  
  5887.  
  5888.  
  5889.  
  5890.  
  5891.  
  5892.  
  5893.  
  5894.                     SCL1 Version 3.1 - Reference Manual - Page 95
  5895.  
  5896.  
  5897.  
  5898.  
  5899.  
  5900.  
  5901.  
  5902.                                                        File2Buf - HFile2Buf
  5903.           -----------------------------------------------------------------
  5904.                                  File2Buf, HFile2Buf
  5905.           -----------------------------------------------------------------
  5906.  
  5907.           Purpose:    Reads a file into a buffer. With HFile2Buf the file
  5908.                       size can be larger than 64K, using the compact and
  5909.                       large models. HFile2Buf's prototype is declared in
  5910.                       SCL1HUGE.H
  5911.  
  5912.           Prototype:  int File2Buf(char* Filename, char* Buffer,
  5913.                          unsigned int* MaxSize);
  5914.  
  5915.                       int HFile2Buf(char *Filename,char huge *Buffer,
  5916.                          unsigned long *MaxSize);
  5917.  
  5918.           Returns:    Returns "0" when no errors occur. When errors occur
  5919.                       it returns "-1" to indicate a critical DOS error,
  5920.                       "255" to indicate that the file is larger than the
  5921.                       size specified with MaxSize, or the standard DOS
  5922.                       error code for other errors. You must have called
  5923.                       TrapInt24 before in order to trap critical errors.
  5924.                       The number of bytes read are stored in MaxSize.
  5925.  
  5926.           Parameters:
  5927.  
  5928.               Filename - valid pathname of the file to be read (char).
  5929.  
  5930.               Buffer - buffer to hold the information (char pointer for
  5931.               File2Buf and huge file pointer for Hfile2Buf).
  5932.  
  5933.               MaxSize - number of bytes to read (unsigned integer for
  5934.               File2Buf and unsigned long for Hfile2Buf).
  5935.  
  5936.           Example:    See Buf2Disk
  5937.  
  5938.           See also Buf2Disk, HBuf2Disk and TrapInt24.
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.  
  5948.  
  5949.  
  5950.  
  5951.  
  5952.  
  5953.  
  5954.  
  5955.                     SCL1 Version 3.1 - Reference Manual - Page 96
  5956.  
  5957.  
  5958.  
  5959.  
  5960.  
  5961.  
  5962.  
  5963.                                                                   FillBlock
  5964.           -----------------------------------------------------------------
  5965.                                       FillBlock
  5966.           -----------------------------------------------------------------
  5967.  
  5968.           Purpose:    Fills a screen area, defined with the parameters
  5969.                       passed to the function, with a given character.
  5970.  
  5971.           Prototype:  void FillBlock(int Color,int UpperRow,int LeftCol,
  5972.                          int LowerRow,int RightCol,int Character);
  5973.  
  5974.           Returns:    Nothing
  5975.  
  5976.           Parameters:
  5977.  
  5978.               Color - color attribute for the display (integer).
  5979.  
  5980.               UpperRow - upper row position of the display area (integer).
  5981.  
  5982.               LeftCol - left column position of the display area (integer).
  5983.  
  5984.               LowerRow - lower row position of the display area (integer).
  5985.  
  5986.               RightCol - right column position of the display area
  5987.               (integer).
  5988.  
  5989.               Character - character to be used for filling the screen area. 
  5990.               This can be any valid character (integer).
  5991.  
  5992.           Example:
  5993.  
  5994.           #include <scl1.h>
  5995.           #include <scl1clor.h>
  5996.  
  5997.           int Color1=BLACK_WHITE;
  5998.  
  5999.           main()
  6000.           {
  6001.           FillBlock(Color1,2,2,20,40,178);
  6002.           /*  Will fill the area between rows 2-10 and columns 20-40 with
  6003.               character 178. */
  6004.           }
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.  
  6015.  
  6016.                     SCL1 Version 3.1 - Reference Manual - Page 97
  6017.  
  6018.  
  6019.  
  6020.  
  6021.  
  6022.  
  6023.  
  6024.                                                        FindFirst - FindNext
  6025.           -----------------------------------------------------------------
  6026.                                  FindFirst, FindNext
  6027.           -----------------------------------------------------------------
  6028.  
  6029.           Purpose:    Searches a disk directory for the file that matches
  6030.                       the specified search attributes using DOS system call
  6031.                       0x4e. After finding the first matching file you must
  6032.                       use FindNext to get subsequent matching files.
  6033.  
  6034.           Prototype:  int FindFirst(char *SearchString,struct FileData
  6035.                          *Buffer, int SearchAtr);
  6036.  
  6037.                       int FindNext(void);
  6038.  
  6039.           Returns:    The DOS error code or "0" if no error occurs.  (See
  6040.                       Appendix "A", FILE FUNCTIONS, for more information).
  6041.                       DOS error code "18" is returned when no more files
  6042.                       are found.
  6043.  
  6044.           Parameters:
  6045.  
  6046.               SearchString - pointer to a string with the search mask to be
  6047.               used (for example C:\BIN\*.EXE). If a matching file is found
  6048.               the FileData structure is filled with the file information.
  6049.  
  6050.               FileData - pointer to a structure of type FileData defined in
  6051.               SCL1.H:
  6052.  
  6053.           struct FileData{
  6054.               char reserved[21];     Is an area reserved by DOS for
  6055.                                      subsequent calls to FindNext.
  6056.  
  6057.               char attrib;           Identifies the type of file found. Can
  6058.                                      be one or more of the following
  6059.                                      constants defined in SCL1.H: (use an
  6060.                                      OR operation to add them)
  6061.  
  6062.                                      F_READ_ONLY, F_HIDDEN, F_SYSTEM,
  6063.                                      F_VOLUME, F_DIRECTORY, F_ARCHIVE
  6064.  
  6065.               struct FILETIME time;  Structure with bit-fields members that
  6066.                                      holds the time when the file was
  6067.                                      created or last updated. FILETIME
  6068.                                      structure is defined in SCL1.H:
  6069.  
  6070.                   struct FILETIME{
  6071.                       unsigned int seconds:5; Value from "0" to "59".
  6072.                       unsigned int minutes:6; Value from "0" to "59".
  6073.                       unsigned int hours:5;   Value from "0" to "24".
  6074.                       };
  6075.  
  6076.  
  6077.                     SCL1 Version 3.1 - Reference Manual - Page 98
  6078.  
  6079.  
  6080.  
  6081.  
  6082.  
  6083.  
  6084.  
  6085.                                                        FindFirst - FindNext
  6086.  
  6087.                   struct FILEDATE date; structure with bit-fields members
  6088.                                         that holds the date when the file
  6089.                                         was created or last updated.
  6090.                                         FILEDATE structure is defined in
  6091.                                         SCL1.H:
  6092.  
  6093.                   struct FILEDATE{
  6094.                       unsigned int day:5;     Value from "1" to "31".
  6095.                       unsigned int month:4;   Value from "1" to "12".
  6096.                       unsigned int year:7;    value from "0" to "119", to
  6097.                                               get the real year add "80" to
  6098.                                               this value.
  6099.                       };
  6100.  
  6101.               long size;          File's size in bytes.
  6102.  
  6103.               char name[13];      File's name.
  6104.               };
  6105.  
  6106.               SearchAtr - is the DOS file attribute of eligible files
  6107.               (files that will be reported). The following attribute
  6108.               constants have been defined in SCL1.H:
  6109.  
  6110.                          F_ARCHIVE      only archive files.
  6111.                          F_DIRECTORY    archive and directories.
  6112.                          F_READ_ONLY    archive and read-only files.
  6113.                          F_HIDDEN       archive and hidden files.
  6114.                          F_SYSTEM       archive and system files.
  6115.                          F_VOLUME       ONLY the volume label is reported.
  6116.  
  6117.           Note:   This functions sets the DTA (Disk Transfer Area) to point
  6118.                   to the FileData structure. Is important that you do not
  6119.                   modify the DTA between a call to FindFirst and FindNext.
  6120.                   The DTA must be declared as static data.
  6121.  
  6122.           Example:
  6123.  
  6124.           #include <scl1.h>
  6125.  
  6126.             /* Shows the use of FindFirst/Next to get a directory list */
  6127.  
  6128.           #define NO_MORE_FILES   18
  6129.  
  6130.           static void printinfo(struct FileData *fd);
  6131.  
  6132.           struct FileData fd;  /* file info will be stored here */
  6133.  
  6134.           main()
  6135.           {
  6136.           int RetVal;
  6137.  
  6138.                     SCL1 Version 3.1 - Reference Manual - Page 99
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146.                                                        FindFirst - FindNext
  6147.  
  6148.           RetVal=FindFirst("*.*",&fd,F_VOLUME);   /* read volume label */
  6149.           if(RetVal==NO_MORE_FILES)               /* no more files? */
  6150.               printf("\nVolume has no label\n\n");
  6151.           else
  6152.               printf("\nVolume label: %s\n\n",fd.name);
  6153.  
  6154.               /*  read other files. Subdirectories, hidden, system and
  6155.                   archive files */
  6156.  
  6157.           RetVal=FindFirst("*.*",&fd,F_DIRECTORY | F_SYSTEM | F_HIDDEN);
  6158.  
  6159.               /*  Get filenames while no error is reported */
  6160.  
  6161.           while(RetVal==0)
  6162.               {
  6163.               printinfo(&fd);        /* print file information */
  6164.               RetVal=FindNext();     /* get next file */
  6165.               }
  6166.           }
  6167.  
  6168.           static void printinfo(struct FileData *fd)
  6169.           {
  6170.           printf("%-13s",fd->name); /* print file name */
  6171.  
  6172.               /* if file is not a directory, print file size */
  6173.  
  6174.           if(fd->attrib == F_DIRECTORY)
  6175.               printf("  <DIR>");
  6176.           else
  6177.               printf("%7li",fd->size);
  6178.  
  6179.           /* print date and time */
  6180.  
  6181.           printf("  %.2i-%.2i-%.2i  %.2i:%.2i:%.2i\n",fd->date.month,
  6182.                   fd->date.day,fd->date.year+80,fd->time.hours,
  6183.                   fd->time.minutes, fd->time.seconds);
  6184.  
  6185.  
  6186.  
  6187.  
  6188.  
  6189.  
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.                     SCL1 Version 3.1 - Reference Manual - Page 100
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.                                              GetCharSet - GetCharSetAddress
  6208.           -----------------------------------------------------------------
  6209.                                       GetCharSet
  6210.           -----------------------------------------------------------------
  6211.  
  6212.           Purpose:    Copies one or more character definitions from the
  6213.                       active character definition table in use by the BIOS
  6214.                       to an user defined buffer. Each character is defined
  6215.                       in an 8 bits rows by 32 lines matrix.  Each screen
  6216.                       scan line is represented by one byte (8 bits). VGA
  6217.                       monitors normally use the first 16 bytes, EGA 14 and
  6218.                       CGA 8, but the BIOS uses 32 bytes tables for each
  6219.                       character. This function can be used before you call
  6220.                       the ModifyCharSet function to modify characters so
  6221.                       that you can restore them to the original values. 
  6222.                       See Appendix "J".
  6223.  
  6224.           Prototype:  void GetCharSet(int StartCode,int TotalChars,
  6225.                          char *Buffer);
  6226.  
  6227.           Returns:    Nothing
  6228.  
  6229.           Parameters:
  6230.  
  6231.               StartCode - ASCII code of the first character to store
  6232.               (integer).
  6233.  
  6234.               TotalChars - number of characters to store (integer).
  6235.  
  6236.               Buffer - pointer to a buffer that will contain a bitmap of
  6237.               the stored characters. The buffer size needs to be equal to
  6238.               the number of characters * 32.
  6239.  
  6240.           Example:    See ModifyCharSet
  6241.  
  6242.  
  6243.           -----------------------------------------------------------------
  6244.                                   GetCharSetAddress
  6245.           -----------------------------------------------------------------
  6246.  
  6247.           Purpose:    Gets the ROM character tables address. You must
  6248.                       specify which character table you desire using one of
  6249.                       the constants defined in SCL1.H (GCA_8X8A, GCA_8X8B,
  6250.                       GCA_8X14, GCA_8X16). Refer to Appendix "J".
  6251.  
  6252.           Prototype:  char far * GetCharSetAddress(int table);
  6253.  
  6254.           Returns:    Far pointer to one of the BIOS character definition
  6255.                       tables stored in ROM.
  6256.  
  6257.           Parameters: Table - character table number (integer).
  6258.  
  6259.  
  6260.                     SCL1 Version 3.1 - Reference Manual - Page 101
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.                                      GetCurCol - GetCurLine - GetCurrentDir
  6269.           -----------------------------------------------------------------
  6270.                                 GetCurCol, GetCurLine
  6271.           -----------------------------------------------------------------
  6272.  
  6273.           Purpose:    Returns the current cursor position.
  6274.  
  6275.           Prototype:  int GetCurCol(void);
  6276.                       int GetCurLine(void);
  6277.  
  6278.           Returns:    GetCurCol returns the column position and GetCurLine
  6279.                       returns the row position.
  6280.  
  6281.           Parameters: None
  6282.  
  6283.           Example:    See PopCursor
  6284.  
  6285.           -----------------------------------------------------------------
  6286.                                     GetCurrentDir
  6287.           -----------------------------------------------------------------
  6288.  
  6289.           Purpose:    Returns a string holding the default drive and path.
  6290.  
  6291.           Prototype:  int GetCurrentDir(char *PathBuffer);
  6292.  
  6293.           Returns:    The DOS error code or "0" if no error occurs.  (See
  6294.                       Appendix "A", FILE FUNCTIONS, for more information).
  6295.  
  6296.           Parameter:  PathBuffer - pointer to a buffer to hold the pathname
  6297.                       and drive letter (char).
  6298.  
  6299.           Example:
  6300.  
  6301.           #include <scl1.h>
  6302.  
  6303.           main()
  6304.           {
  6305.           int i,char buffer[160];
  6306.           i=GetCurrentDir(buffer);
  6307.           if(i)
  6308.               printf("\nDOS reports error #%i\n",i);
  6309.           else
  6310.               printf("\nCurrent directory is %s\n",buffer);
  6311.           }
  6312.  
  6313.  
  6314.  
  6315.  
  6316.  
  6317.  
  6318.  
  6319.  
  6320.  
  6321.                     SCL1 Version 3.1 - Reference Manual - Page 102
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.                                                                  GetCurSize
  6330.           -----------------------------------------------------------------
  6331.                                       GetCurSize
  6332.           -----------------------------------------------------------------
  6333.  
  6334.           Purpose:    Saves the current cursor size in variable
  6335.                       GCS_CursorSize and returns the current cursor size.
  6336.  
  6337.           Prototype:  int GetCurSize(void);
  6338.  
  6339.           Returns:    The current cursor size.
  6340.  
  6341.           Parameters: None
  6342.  
  6343.           Example:
  6344.  
  6345.           #include <scl1.h>
  6346.  
  6347.           main()
  6348.           {
  6349.           int i;
  6350.  
  6351.           i=GetCurSize();
  6352.           printf("\nCursor size has been saved in local variable, hit any
  6353.                   key...\n");
  6354.           GetKey();
  6355.           BigCursor();
  6356.           printf("\nCursor size has been modified, original size will
  6357.                   be restored by passing\n");
  6358.           printf("original size value to SetCursize function, hit any
  6359.                   key...\n");
  6360.           GetKey();
  6361.           SetCurSize(i);
  6362.           }
  6363.  
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.                     SCL1 Version 3.1 - Reference Manual - Page 103
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.                                                                     GetDate
  6391.           -----------------------------------------------------------------
  6392.                                        GetDate
  6393.           -----------------------------------------------------------------
  6394.  
  6395.           Purpose:    Gets the system date.
  6396.  
  6397.           Prototype:  struct DateData * GetDate(void);
  6398.  
  6399.           Returns:    A pointer to the DateData structure defined as
  6400.                       follows:
  6401.  
  6402.           struct DateData{
  6403.               int WeekDay;  day of the week in numerical format (0=sunday).
  6404.  
  6405.               int MonthDay; day of the month (1 - 31).
  6406.  
  6407.               int Month;    month number (1 - 12).
  6408.  
  6409.               int Year;     year (1980 - 2099).
  6410.               };
  6411.  
  6412.           Parameters: None
  6413.  
  6414.           Example:
  6415.  
  6416.           #include <scl1.h>
  6417.  
  6418.           char *Day[]={"Sunday","Monday","Tuesday","Wednesday","Thursday",
  6419.                        "Friday","Saturday"};
  6420.  
  6421.           char
  6422.           *Month[]={"","January","February","March","April","May","June",
  6423.  
  6424.           "July","August","September","October","November","December"};
  6425.           main()
  6426.           {
  6427.           struct DateData *p;
  6428.           p=GetDate();
  6429.           /* p points to DateData structure:
  6430.               p->WeekDay = day of the week (0=Sunday),
  6431.               p->MonthDay = day (1-31),
  6432.               p->Month = month (1-12)
  6433.               p->Year = year (1980 - 2099).
  6434.           The month and day numbers reported by GetDate will be used as an
  6435.           index to the week and months names arrays we have previously
  6436.           defined.*/
  6437.  
  6438.           printf("Today is %s, %s %d,%d",Day[p->WeekDay],
  6439.                 Month[p->Month],p->MonthDay,p->Year);
  6440.           }
  6441.  
  6442.  
  6443.                     SCL1 Version 3.1 - Reference Manual - Page 104
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.                                          GetDefaultDrive - GetDiskFreeSpace
  6452.           -----------------------------------------------------------------
  6453.                                    GetDefaultDrive
  6454.           -----------------------------------------------------------------
  6455.  
  6456.           Purpose:    Gets the default disk drive.
  6457.  
  6458.           Prototype:  int GetDefaultDrive(void);
  6459.  
  6460.           Returns:    The default drive number, 0=A, 1=B, etc.
  6461.  
  6462.           Parameters: None
  6463.  
  6464.           Example:
  6465.  
  6466.           #include <scl1.h>
  6467.  
  6468.           main()
  6469.           {
  6470.           int Drive;
  6471.  
  6472.           Drive=GetDefaultDrive();
  6473.           printf("The default drive is %c\n",'A'+Drive)
  6474.           }
  6475.  
  6476.           -----------------------------------------------------------------
  6477.                                    GetDiskFreeSpace
  6478.           -----------------------------------------------------------------
  6479.  
  6480.           Purpose:    Gets the selected disk drive's free space in bytes.
  6481.  
  6482.           Prototype:  long GetDefaultDrive(int Drive);
  6483.  
  6484.           Returns:    The number of bytes free in the selected drive, "-1"
  6485.                       if TrapInt24 was initialized and a critical error
  6486.                       occurs or "-2" if the drive number is illegal.
  6487.  
  6488.           Parameter:  Drive - drive number as an integer (for example; 0 -
  6489.                       default, 1-A, 2-B, etc.)
  6490.  
  6491.           Example:
  6492.  
  6493.           #include <scl1.h>
  6494.  
  6495.           main()
  6496.           {
  6497.           printf("Disk Free Space=%li\n",GetDiskFreeSpace(0));
  6498.           }
  6499.  
  6500.  
  6501.  
  6502.  
  6503.  
  6504.                     SCL1 Version 3.1 - Reference Manual - Page 105
  6505.  
  6506.  
  6507.  
  6508.  
  6509.  
  6510.  
  6511.  
  6512.                                                            GetExtendedAscii
  6513.           -----------------------------------------------------------------
  6514.                                    GetExtendedAscii
  6515.           -----------------------------------------------------------------
  6516.  
  6517.           Purpose:    Changes ALT+Key combination into Extended Ascii
  6518.                       character according to 4 tables
  6519.  
  6520.           Prototype:  unsigned int GetExtendedAscii(unsigned int Key);
  6521.  
  6522.           Returns:    The Ascii Code, if found (<"255"), or original
  6523.                       Scan+Ascii Code, if not found (>"255").
  6524.  
  6525.           Table 0 is the default. To change table set variable GE_CharTable
  6526.           to desired table number. The tables have been defined as follows:
  6527.  
  6528.               Table 0 -  ALT+  aeiouvnm12
  6529.                                áéíóúüñÑ¡¿
  6530.  
  6531.               Table 1 -  ALT+  123456789  qwertyuiop  asdfghjkl  zxcvbnm
  6532.                                âêîôû£₧ƒ¥  áéíóúÿçÇñÑ  àèÄòùÄÉÖÜ  äëïöü¡¿
  6533.  
  6534.               Table 2 -  ALT+  123456789  qwertyuiop  asdfghjkl  zxcvbnm
  6535.                                ╔╗╚╝═║░▒▓  ╦╠╣╩╬█▄▌▐▀  ┌┐└┘─│ΦΘΩ  ┬├┤┴┼«»
  6536.  
  6537.               Table 3 -  ALT+  123456789  qwertyui  asdfghjkl  zx
  6538.                                αßΓπΣσµτΦ  ΘΩδ∞φε∩≡  ±≥≤⌠⌡÷≈√   ² 
  6539.  
  6540.           Parameter:  Key - Scan and ASCII code of a key (unsigned int).
  6541.  
  6542.           Example:
  6543.           #include <scl1.h>
  6544.           #include <scl1keys.h>
  6545.  
  6546.           main()
  6547.           {
  6548.           unsigned int key;
  6549.  
  6550.           do
  6551.               {
  6552.               printf("Press an ALT + Key combination...");
  6553.               key=GetKey();
  6554.               if((key=GetExtendenAscii(key)) < 255)
  6555.                   {
  6556.                   printf("%c\n",key);
  6557.                   break;
  6558.                   }
  6559.               else
  6560.                   printf("\nThis key combination has not been defined,
  6561.                          try again!\n:);
  6562.               }while(1);
  6563.           }
  6564.  
  6565.                     SCL1 Version 3.1 - Reference Manual - Page 106
  6566.  
  6567.  
  6568.  
  6569.  
  6570.  
  6571.  
  6572.  
  6573.                                                                    GetFiles
  6574.           -----------------------------------------------------------------
  6575.                                        GetFiles
  6576.           -----------------------------------------------------------------
  6577.  
  6578.           Purpose:    Searches for the files that match the specified
  6579.                       search string and attributes. Sets global variable
  6580.                       GF_FileNumber to the number of files found and
  6581.                       initialize an array of pointers, GF_PointerBuf, which
  6582.                       will point to the filenames.
  6583.  
  6584.           Prototype:  int GetFiles(char *SearchString,int SearchAtr);
  6585.  
  6586.           Returns:    The DOS error code or "0" if no error occurs.  (See
  6587.                       Appendix "A", FILE FUNCTIONS, for more information).
  6588.  
  6589.           Parameters:
  6590.  
  6591.               SearchString - char pointer to the desired search string.
  6592.  
  6593.               SearchAtr - variable that defines the desired search
  6594.               attributes (integer).
  6595.  
  6596.           Example:
  6597.  
  6598.           #include <scl1.h>
  6599.  
  6600.           main()
  6601.           {
  6602.           int i;
  6603.  
  6604.           if(i=GetFiles("*.*",F_ARCHIVE+F_DIRECTORY))
  6605.               printf("GetFiles reports error number %i\n",i);
  6606.           else
  6607.               {
  6608.               for(i=0;i < GF_FileNumber;++i)
  6609.                   printf("%s\n",GF_PointerBuf[i]);
  6610.               }
  6611.           }
  6612.  
  6613.  
  6614.  
  6615.  
  6616.  
  6617.  
  6618.  
  6619.  
  6620.  
  6621.  
  6622.  
  6623.  
  6624.  
  6625.  
  6626.                     SCL1 Version 3.1 - Reference Manual - Page 107
  6627.  
  6628.  
  6629.  
  6630.  
  6631.  
  6632.  
  6633.  
  6634.                                                                 GetFileMode
  6635.           -----------------------------------------------------------------
  6636.                                      GetFileMode
  6637.           -----------------------------------------------------------------
  6638.  
  6639.           Purpose:    Gets the selected file's attributes.
  6640.  
  6641.           Prototype:  int GetFileMode(char *Filename,int *FMode);
  6642.  
  6643.           Returns:    The DOS error code or "0" if no error occurs. (See
  6644.                       Appendix "A", FILE FUNCTIONS, for more information).
  6645.  
  6646.           Parameters:
  6647.  
  6648.               Filename - pointer to the file's name.
  6649.  
  6650.               Fmode - pointer to a variable that will hold the file mode
  6651.               (int).
  6652.  
  6653.           The following masks has been defined in SCL1.H:
  6654.  
  6655.                   F_READ_ONLY, F_HIDDEN, F_SYSTEM, F_VOLUME
  6656.                   F_DIRECTORY, F_ARCHIVE
  6657.  
  6658.           Example:
  6659.  
  6660.           #include <scl1.h>
  6661.  
  6662.           char Filename[]="FILE.1";
  6663.  
  6664.           main()
  6665.           {
  6666.           int handle;
  6667.           unsigned int FMode;
  6668.  
  6669.           if(CreateFile(Filename,&handle,F_ARCHIVE))
  6670.               exit(-1);
  6671.           if(GetFileMode(Filename,&FMode))
  6672.               exit(-1);
  6673.           PrintFMode(FMode);
  6674.           if(SetFileMode(Filename,F_READ_ONLY | F_SYSTEM | F_HIDDEN))
  6675.               exit(-1);
  6676.           if(GetFileMode(Filename,&FMode))
  6677.               exit(-1);
  6678.           PrintFMode(FMode);
  6679.           if(SetFileMode(Filename,F_ARCHIVE))
  6680.               exit(-1);
  6681.           DeleteFile(Filename);
  6682.           }
  6683.  
  6684.           PrintFMode(unsigned int FMode)
  6685.           {
  6686.  
  6687.                     SCL1 Version 3.1 - Reference Manual - Page 108
  6688.  
  6689.  
  6690.  
  6691.  
  6692.  
  6693.  
  6694.  
  6695.                                                     GetFileMode - GetFilePt
  6696.  
  6697.           printf("\nFile attributes:\n\n");
  6698.           if(FMode & F_READ_ONLY)
  6699.               printf("\tRead Only\n");
  6700.           if(FMode & F_HIDDEN)
  6701.               printf("\tHidden\n");
  6702.           if(FMode & F_SYSTEM)
  6703.               printf("\tSystem\n");
  6704.           if(FMode & F_ARCHIVE)
  6705.               printf("\tArchive\n");
  6706.           }
  6707.  
  6708.           -----------------------------------------------------------------
  6709.                                       GetFilePt
  6710.           -----------------------------------------------------------------
  6711.  
  6712.           Purpose:    Gets the file's pointer position.
  6713.  
  6714.           Prototype:  long GetFilePt(int Handle);
  6715.  
  6716.           Returns:    The file pointer position of the file whose handle is
  6717.                       Handle or "-1" if a critical error is detected. (See
  6718.                       Appendix "A", FILE FUNCTIONS, for more information).
  6719.  
  6720.           Parameter:  Handle - Handle returned by DOS when you open or
  6721.                       create a file (integer).
  6722.  
  6723.           Example:
  6724.  
  6725.           #include <scl1.h>
  6726.           #include <string.h>
  6727.  
  6728.           /*  This example creates a file with several names in lower case.
  6729.               We'll read this file one record at a time into our buffer and
  6730.               convert the string to uppercase before rewriting it back to
  6731.               disk. For simplicity, no error checking is shown in the
  6732.               example */
  6733.  
  6734.           struct NAME_REC{     /* Our file format */
  6735.                char Name[7];
  6736.                }nr;            /* nr will be used as a buffer for
  6737.                                   converting strings to uppercase */
  6738.  
  6739.           /* This is the data of the file we will create */
  6740.  
  6741.           struct NAME_REC names[]={
  6742.               "John",
  6743.               "Mary",
  6744.               "Robert",
  6745.               "Ann"};
  6746.  
  6747.  
  6748.                     SCL1 Version 3.1 - Reference Manual - Page 109
  6749.  
  6750.  
  6751.  
  6752.  
  6753.  
  6754.  
  6755.  
  6756.                                                                   GetFilePt
  6757.  
  6758.           main()
  6759.           {
  6760.           int handle,i,j;
  6761.           long fileptr,records;
  6762.  
  6763.              /* create file */
  6764.  
  6765.           if(Buf2Disk("DEMO.FL",(char *)names,sizeof(names)))
  6766.               {
  6767.               printf("Error creating file\n");
  6768.               exit(-1);
  6769.               }
  6770.  
  6771.               /* Open file for reading and writing */
  6772.  
  6773.           OpenFile("DEMO.FL",&handle,DOS2_RW);
  6774.  
  6775.           /*  number of records in file = file size/size of structure
  6776.               NAME_REC */
  6777.  
  6778.           records=GetFileSize(handle)/sizeof(struct NAME_REC);
  6779.  
  6780.           /*  read one record at a time while there are records */
  6781.           for(;records > 0;--records)
  6782.               {
  6783.  
  6784.               /* save actual file pointer position */
  6785.               fileptr=GetFilePt(handle);
  6786.  
  6787.               /*  read data, file pointer is automatically moved to next
  6788.                   record by DOS */
  6789.  
  6790.               ReadFile(handle,(char *)&nr,sizeof(struct NAME_REC));
  6791.  
  6792.               /*  capitalize name */
  6793.               strupr(nr.Name);
  6794.  
  6795.               /*  move file pointer to original position */
  6796.               MoveFilePt2Offset(handle,fileptr);
  6797.  
  6798.               /*  write our data, pointer points again to next record */
  6799.               WriteFile(handle,(char *)&nr,sizeof(struct NAME_REC));
  6800.               }
  6801.           CloseFile(handle);
  6802.           system("type DEMO.FL");
  6803.           }
  6804.  
  6805.  
  6806.  
  6807.  
  6808.  
  6809.                     SCL1 Version 3.1 - Reference Manual - Page 110
  6810.  
  6811.  
  6812.  
  6813.  
  6814.  
  6815.  
  6816.  
  6817.                                                    GetFileSize - GetFreeMem
  6818.           -----------------------------------------------------------------
  6819.                                      GetFileSize
  6820.           -----------------------------------------------------------------
  6821.  
  6822.           Purpose:    Gets the size of the selected file.
  6823.  
  6824.           Prototype:  long GetFileSize(int Handle);
  6825.  
  6826.           Returns:    The size of the file whose handle is Handle or "-1"
  6827.                       if a critical error is detected. (See Appendix "A",
  6828.                       FILE FUNCTIONS, for more information).
  6829.  
  6830.           Parameter:  Handle - Handle returned by DOS when you open or
  6831.                       create a file (integer).
  6832.  
  6833.           Example:    See GetFilePt
  6834.  
  6835.           -----------------------------------------------------------------
  6836.                                       GetFreeMem
  6837.           -----------------------------------------------------------------
  6838.  
  6839.           Purpose:    Gets the free memory reported by DOS in your system.
  6840.  
  6841.           Prototype:  long GetFreeMem(void);
  6842.  
  6843.           Returns:    The amount of free memory, in bytes, reported by DOS.
  6844.  
  6845.           Parameters: None
  6846.  
  6847.           Example:
  6848.  
  6849.           #include <scl1.h>
  6850.  
  6851.           main()
  6852.           {
  6853.           printf("Available memory: %li",GetFreeMem());
  6854.           }
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.                     SCL1 Version 3.1 - Reference Manual - Page 111
  6871.  
  6872.  
  6873.  
  6874.  
  6875.  
  6876.  
  6877.  
  6878.                                                                      GetKey
  6879.           -----------------------------------------------------------------
  6880.                                         GetKey
  6881.           -----------------------------------------------------------------
  6882.  
  6883.           Purpose:    Waits and returns the pressed key's Scan/ASCII code.
  6884.                       If the CheckEnhancedKeyb function has been called and
  6885.                       an enhanced keyboard has been detected, GetKey will
  6886.                       also return the Scan/ASCII codes of the extra keys in
  6887.                       the enhanced keyboard.
  6888.  
  6889.           Prototype:  unsigned int GetKey(void);
  6890.  
  6891.           Returns:    The Scan/Ascii code of the pressed key. See Appendix
  6892.                       "D" for the variables defined in SCL1KEYS.H.
  6893.  
  6894.           Parameters: None
  6895.  
  6896.           Example:
  6897.  
  6898.           #include <scl1.h>
  6899.           #include <scl1keys.h>
  6900.  
  6901.           main()
  6902.           {
  6903.           unsigned int Key;
  6904.  
  6905.           if(CheckEnhancedKeyb())
  6906.               printf("Enhanced Keyboard\n");
  6907.           else
  6908.               printf("No Enhanced Keyboard available\n");
  6909.  
  6910.           do
  6911.               {
  6912.               switch(Key=GetKey())
  6913.                   {
  6914.                   case ENH_ENTER:
  6915.                   case ENTER:
  6916.                       printf("Enter\n");
  6917.                       break;
  6918.                   case ENH_DEL:
  6919.                   case DEL:
  6920.                       printf("Delete\n");
  6921.                       break;
  6922.                   case ENH_INS:
  6923.                   case INS:
  6924.                       printf("Insert\n");
  6925.                       break;
  6926.                   case ENH_END:
  6927.                   case END:
  6928.                       printf("End\n");
  6929.                       break;
  6930.  
  6931.                     SCL1 Version 3.1 - Reference Manual - Page 112
  6932.  
  6933.  
  6934.  
  6935.  
  6936.  
  6937.  
  6938.  
  6939.                                                                      GetKey
  6940.  
  6941.                   case ENH_CTRLEND:
  6942.                       printf("Enhanced Control End\n");
  6943.                       break;
  6944.                   case CTRLEND:
  6945.                       printf("Control End\n");
  6946.                       break;
  6947.                   case F11:
  6948.                       printf("F11\n");
  6949.                       break;
  6950.                   case F12:
  6951.                       printf("F12\n");
  6952.                       break;
  6953.                   case SHIFTF11:
  6954.                       printf("Shift F11\n");
  6955.                       break;
  6956.                   case SHIFTF12:
  6957.                       printf("Shift F12\n");
  6958.                       break;
  6959.                   case CTRLF11:
  6960.                       printf("Control F11\n");
  6961.                       break;
  6962.                   case CTRLF12:
  6963.                       printf("Control F12\n");
  6964.                       break;
  6965.                   case ALTF11:
  6966.                       printf("Alt F11\n");
  6967.                       break;
  6968.                   case ALTF12:
  6969.                       printf("Alt F12\n");
  6970.                       break;
  6971.                   default:
  6972.                       printf("%X\n",Key);
  6973.                       break;
  6974.                   }
  6975.               }while(Key != ESC);
  6976.           }
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.  
  6986.  
  6987.  
  6988.  
  6989.  
  6990.  
  6991.  
  6992.                     SCL1 Version 3.1 - Reference Manual - Page 113
  6993.  
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000.                                                                   GetString
  7001.           -----------------------------------------------------------------
  7002.                                       GetString
  7003.           -----------------------------------------------------------------
  7004.  
  7005.           Purpose:    Saves the cursor position, displays a prompt, the
  7006.                       current buffer contents and fills the buffer with
  7007.                       keyboard input. If variable GS_Insert is set to "1"
  7008.                       prior to calling GetString, it will start in the
  7009.                       insert mode. When an entry has been made into the
  7010.                       buffer the variable GS_Edit is set to "1". If GS_Beep
  7011.                       is set to "1" the speaker will sound if an invalid
  7012.                       key is pressed. The buffer must be initialized.
  7013.  
  7014.           Prototype:  int GetString(int PColor,int PRow,int PCol,
  7015.                          char* Prompt,int FColor,int FRow,int FCol,
  7016.                          int MaxChar,unsigned int CharType,char *Buffer);
  7017.  
  7018.           Returns:    The number of characters in Buffer or "-1" if the Esc
  7019.                       key is pressed.
  7020.  
  7021.           Parameters:
  7022.  
  7023.               PColor - color attribute of the prompt (integer).
  7024.  
  7025.               PRow - row position where to display the prompt (integer).
  7026.  
  7027.               PCol - column position where to display the prompt (int).
  7028.  
  7029.               Prompt - pointer to the prompt to be displayed (char).
  7030.  
  7031.               FColor - color attribute of the field (integer).
  7032.  
  7033.               FRow - row position where to display the field (integer).
  7034.  
  7035.               FCol - column position where to display the field (int).
  7036.  
  7037.               MaxChar - length of the input field (integer).
  7038.  
  7039.               CharType - mask of valid characters as described in
  7040.               CheckChar.
  7041.  
  7042.               Buffer - pointer to the buffer to be used to store the field,
  7043.               it must be one digit larger than the field's size.
  7044.  
  7045.           Example:
  7046.           #include <scl1.h>
  7047.           char Buffer[32];
  7048.           main()
  7049.           {
  7050.           GetString(7,10,20,"Name:",0x70,10,28,31,CC_ANY,Buffer);
  7051.           }
  7052.  
  7053.                     SCL1 Version 3.1 - Reference Manual - Page 114
  7054.  
  7055.  
  7056.  
  7057.  
  7058.  
  7059.  
  7060.  
  7061.                                                          GetTime - Huge2Far
  7062.           -----------------------------------------------------------------
  7063.                                        GetTime
  7064.           -----------------------------------------------------------------
  7065.  
  7066.           Purpose:    Gets the system time. Sets global variables GT_Hours,
  7067.                       GT_Minutes, GT_Seconds and GT_Hundredths to the
  7068.                       system time.
  7069.  
  7070.           Prototype:  char *GetTime(void);
  7071.  
  7072.           Returns:    A pointer to a buffer that holds the system time in
  7073.                       ASCII.
  7074.  
  7075.           Parameters: None
  7076.  
  7077.           Example:
  7078.  
  7079.           #include <scl1.h>
  7080.  
  7081.           main()
  7082.           {
  7083.           WriteScreen(0x7,3,3,"Time:");
  7084.           WriteScreen(0x7,3,9,GetTime());
  7085.           }
  7086.  
  7087.           -----------------------------------------------------------------
  7088.                                        Huge2Far
  7089.           -----------------------------------------------------------------
  7090.  
  7091.           Purpose:    Converts a huge pointer to a far pointer. It is used
  7092.                       to convert huge pointers before passing them to an
  7093.                       SCL1 function. (Works only in the compact and large
  7094.                       models of the Microsoft C version of SCL1). The
  7095.                       function prototype is declared in SCL1HUGE.H
  7096.  
  7097.           Prototype:  far* Huge2Far(huge* p);
  7098.  
  7099.           Returns:    A far pointer.
  7100.  
  7101.           Parameter:  p - huge pointer to be converted.
  7102.  
  7103.           Example:
  7104.  
  7105.           #include <SCL1HUGE.H>
  7106.  
  7107.           main()
  7108.           {
  7109.           char *p;
  7110.           huge *h;
  7111.           p=Huge2Far(h);
  7112.           }
  7113.  
  7114.                     SCL1 Version 3.1 - Reference Manual - Page 115
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.                                                       HideMouse - ShowMouse
  7123.           -----------------------------------------------------------------
  7124.                                  HideMouse, ShowMouse
  7125.           -----------------------------------------------------------------
  7126.           Purpose:    Hides or removes the mouse cursor from the screen
  7127.                       (HideMouse) or makes mouse cursor visible
  7128.                       (ShowMouse).
  7129.  
  7130.           Prototype:  void HideMouse(void);
  7131.                       void ShowMouse(void);
  7132.  
  7133.           Returns:    Nothing
  7134.  
  7135.           Parameters: None
  7136.  
  7137.           Example:
  7138.  
  7139.           #include <scl1.h>
  7140.  
  7141.           main()
  7142.           {
  7143.           InitMouse(IM_SHOW); /* initialize mouse, turn cursor on */
  7144.  
  7145.           if(MSE_MouseFl)
  7146.               {
  7147.               printf("We have a mouse, click the left button to turn
  7148.                        mouse cursor off.\n");
  7149.               WaitKeyMouse();
  7150.               HideMouse();
  7151.               printf("Click again to turn mouse cursor on.\n");
  7152.               WaitKeyMouse();
  7153.               ShowMouse();
  7154.               printf("Click to exit.\n");
  7155.               WaitKeyMouse();
  7156.               }
  7157.           else
  7158.               printf("We don't have a mouse\n");
  7159.           }
  7160.  
  7161.  
  7162.  
  7163.  
  7164.  
  7165.  
  7166.  
  7167.  
  7168.  
  7169.  
  7170.  
  7171.  
  7172.  
  7173.  
  7174.  
  7175.                     SCL1 Version 3.1 - Reference Manual - Page 116
  7176.  
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.  
  7183.                                                       InitDrive - InitMouse
  7184.           -----------------------------------------------------------------
  7185.                                       InitDrive
  7186.           -----------------------------------------------------------------
  7187.  
  7188.           Purpose:    Verifies if a disk drive has been assigned more than
  7189.                       one logical drive letters and sets the drive to
  7190.                       respond to a specified letter. Requires DOS 3.2 or
  7191.                       higher. This function is useful to prevent DOS from
  7192.                       displaying the "Insert Diskette in Drive X:".
  7193.  
  7194.           Prototype:  int InitDrive(int Drive);
  7195.  
  7196.           Returns:    If an error has occurred it returns "-1" else it
  7197.                       returns "0".
  7198.  
  7199.           Parameter:  Drive - drive number as an integer (for example; 0 -
  7200.                       default, 1-A, 2-B, etc.)
  7201.  
  7202.           Example:
  7203.  
  7204.           InitDrive(1);   /* makes sure drive A: is ready */
  7205.  
  7206.           -----------------------------------------------------------------
  7207.                                       InitMouse
  7208.           -----------------------------------------------------------------
  7209.  
  7210.           Purpose:    Initializes the mouse for further use of the mouse
  7211.                       functions. When you exit the program it takes care of
  7212.                       resetting the mouse.
  7213.  
  7214.           Prototype:  int InitMouse(int Cursor);
  7215.  
  7216.           Returns:    If an error has occurred it returns "-1".
  7217.  
  7218.           Parameter:  Cursor - this parameter tells InitMouse how to handle
  7219.                       the mouse cursor. The following variables have been
  7220.                       defined in SCL1.H;
  7221.  
  7222.                          IM_SHOW - means to show the mouse cursor (int).
  7223.  
  7224.                          IM_NO_SHOW - means not to show the mouse cursor
  7225.                          (integer).
  7226.  
  7227.           Example:    See HideMouse
  7228.  
  7229.  
  7230.  
  7231.  
  7232.  
  7233.  
  7234.  
  7235.  
  7236.                     SCL1 Version 3.1 - Reference Manual - Page 117
  7237.  
  7238.  
  7239.  
  7240.  
  7241.  
  7242.  
  7243.  
  7244.                                                               InitUserError
  7245.           -----------------------------------------------------------------
  7246.                                     InitUserError
  7247.           -----------------------------------------------------------------
  7248.  
  7249.           Purpose:    Initialize user defined error codes for use with the
  7250.                       ErrorBox function. You can also redefine the standard
  7251.                       ErrorBox messages.
  7252.  
  7253.           Prototype:  void InitUserError(struct ErrorMess *p);
  7254.  
  7255.           Returns:    Nothing
  7256.  
  7257.           Parameters: The Error Message information is placed in an array
  7258.                       of structures as follows: (The array of structures is
  7259.                       terminated with a "0").
  7260.  
  7261.           struct ErrorMess{
  7262.               int ErrorNum;    An integer value for the error number. User
  7263.                                defined values shall be above 256. If a
  7264.                                predefined error message is redefined, the
  7265.                                function will use the new values.
  7266.  
  7267.               char *Message;   Pointer to the defined error message's text.
  7268.               };
  7269.  
  7270.           Example:    See ErrorShadowOn/Off
  7271.  
  7272.  
  7273.           -----------------------------------------------------------------
  7274.                                       InitVideo
  7275.           -----------------------------------------------------------------
  7276.  
  7277.           Purpose:    Initialize video monitor to the alphanumeric display
  7278.                       mode.
  7279.  
  7280.           Prototype:  void InitVideo (void);
  7281.  
  7282.           Returns:    Nothing
  7283.  
  7284.           Parameters: None
  7285.  
  7286.           Example:
  7287.           #include <scl1.h>
  7288.  
  7289.           main()
  7290.           {
  7291.           InitVideo();
  7292.           printf("SCL1's InitVideo function has initialized your
  7293.                    monitor\nto it's default alphanumeric mode.\n");
  7294.           }
  7295.  
  7296.  
  7297.                     SCL1 Version 3.1 - Reference Manual - Page 118
  7298.  
  7299.  
  7300.  
  7301.  
  7302.  
  7303.  
  7304.  
  7305.                                                                   InitWData
  7306.           -----------------------------------------------------------------
  7307.                                       InitWData
  7308.           -----------------------------------------------------------------
  7309.  
  7310.           Purpose:    This version of SCL1 provides another way of defining
  7311.                       and using windows. In these windows you can specify
  7312.                       shadow effect, frames, grow and  shrinking effects,
  7313.                       justification method, etc.  This information can now
  7314.                       be specified using a WData type structure. Once the
  7315.                       window is defined you can use the CreateWindow
  7316.                       function to create the window; ClearWindow to clear
  7317.                       the window; DestroyWindow to destroy the window and
  7318.                       WriteWindow to write information to the window. This
  7319.                       function provides an easy way to initialize this
  7320.                       structure. The structure elements HorSize, VerSize,
  7321.                       HorCenter, VerCenter and Buffer are automatically
  7322.                       initialized.
  7323.  
  7324.  
  7325.           Prototype:  void InitWData(WData *wd,int Color,int Style,
  7326.                          int UpperRow,int LeftCol,int LowerRow,
  7327.                          int RightCol,int FrameType,int TitleColor,
  7328.                          char * Title);
  7329.  
  7330.           Returns:    Nothing
  7331.  
  7332.           Parameters: The window data is stored in a structure WData as
  7333.                       follows:
  7334.  
  7335.           typedef struct{
  7336.               int Color;       Color to be used for the window.
  7337.  
  7338.               int Style;       Defines the way the window will be
  7339.                                displayed. Refer to the Style description
  7340.                                below.
  7341.  
  7342.               int FrameType;   Frame type to be used.
  7343.  
  7344.               int UpperRow;    Upper left row position of the window.
  7345.  
  7346.               int LeftCol;     Upper left column position of the window.
  7347.  
  7348.               int LowerRow;    Lower right row position of the window.
  7349.  
  7350.               int RightCol;    Lower right column position of the window.
  7351.  
  7352.               int TitleColor;  Color to be used for displaying the title.
  7353.  
  7354.               int *Title;      Title's text.
  7355.  
  7356.  
  7357.  
  7358.                     SCL1 Version 3.1 - Reference Manual - Page 119
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.                                                                   InitWData
  7367.  
  7368.               int HorSize;     Structure element (internal) that holds the
  7369.                                window's horizontal size excluding the
  7370.                                frame.  This information can be used to
  7371.                                calculate the window's center for writing
  7372.                                text.
  7373.  
  7374.               int VerSize;     Structure element (internal) that holds the
  7375.                                window's vertical size excluding the frame.
  7376.  
  7377.               int HorCenter;   Structure element (internal) that holds the
  7378.                                window's horizontal center.
  7379.  
  7380.               int VerCenter;   Structure element (internal) that holds the
  7381.                                window's vertical center.
  7382.  
  7383.               char *Buffer;    Buffer for storing the screen area contents.
  7384.               }WData;
  7385.  
  7386.  
  7387.           The following parameters are passed to the function:
  7388.  
  7389.               WData - the address of the WData structure.
  7390.  
  7391.               Color - color to be used for the window (integer).
  7392.  
  7393.               Style - defines the way the window will be displayed. You can
  7394.               concatenate different style options using the "or" (|)
  7395.               operator between options.  The following style options have
  7396.               been defined in SCL1.H:
  7397.  
  7398.                   W_SAVE - save the screen area defined for the window.
  7399.                   W_CLEAR - clear screen area to the defined color.
  7400.                   W_FRAME - add a frame to the window.
  7401.                   W_GROW - use a growing effect when displaying the window.
  7402.                   W_SHRINK - use a shrinking effect when removing the
  7403.                   window.
  7404.                   W_SHADOW - display a shadow effect.
  7405.  
  7406.               UpperRow - upper left row position of the window (integer).
  7407.  
  7408.               LeftCol - upper left column position of the window (integer).
  7409.  
  7410.               LowerRow - lower right row position of the window (integer).
  7411.  
  7412.               RightCol - lower right column position of the window (int).
  7413.  
  7414.               FrameType - any of the frame types defined in Box or GSSBox
  7415.               (int).
  7416.  
  7417.  
  7418.  
  7419.                     SCL1 Version 3.1 - Reference Manual - Page 120
  7420.  
  7421.  
  7422.  
  7423.  
  7424.  
  7425.  
  7426.  
  7427.                                                                   InitWData
  7428.  
  7429.               TitleColor - color to be used for displaying the Title (int).
  7430.  
  7431.               Title - Title to be displayed (char pointer).
  7432.  
  7433.           Example:
  7434.  
  7435.           #include <scl1.h>
  7436.           #include <scl1clor.h>
  7437.  
  7438.           main()
  7439.           {
  7440.           WData wd;
  7441.  
  7442.           /*  Define a window from rows 5 to 17, columns 19 to 59, with
  7443.               frame type 3, white black colors, and with the following
  7444.               styles; save screen area, draw a shadow effect, draw a frame,
  7445.               grow when opening, shrink when closing and add title. */
  7446.  
  7447.           InitWData(&wd,WHITE_BLACK,W_SAVE | W_SHADOW | W_FRAME | W_GROW |
  7448.                   W_SHRINK,5,28,19,73,3,BLACK_WHITE," WINDOW TITLE ");
  7449.  
  7450.           CreateWindow(&wd); /* create the window */
  7451.  
  7452.           /*  Display centralized text in the first row of the window, use
  7453.               HorCenter as column parameter to centralize text use HorSize
  7454.               so that the Horizontal window size is used as Count
  7455.               parameter. */
  7456.  
  7457.           WriteWindow(&wd,1,wd.HorCenter,wd.HorSize,W_CENTER,"Text can
  7458.                    be\ncentralized...");
  7459.  
  7460.           WaitTime(300);
  7461.  
  7462.           /* Display left justified string */
  7463.  
  7464.           WriteWindow(&wd,5,1,wd.HorSize,W_LEFT,"Left\njustified...");
  7465.  
  7466.           WaitTime(300);
  7467.  
  7468.           /*  Display right justified string. Use HorSize to know the
  7469.               window right column value. */
  7470.  
  7471.           WriteWindow(&wd,8,wd.HorSize-2,wd.HorSize,W_RIGHT,"or right\n
  7472.                   justified...");
  7473.  
  7474.           WaitTime(300);
  7475.  
  7476.  
  7477.  
  7478.  
  7479.  
  7480.                     SCL1 Version 3.1 - Reference Manual - Page 121
  7481.  
  7482.  
  7483.  
  7484.  
  7485.  
  7486.  
  7487.  
  7488.                                  InitWData - Int24ShadowOff - Int24ShadowOn
  7489.  
  7490.           /* Clear the window */
  7491.  
  7492.           ClearWindow(&wd);
  7493.  
  7494.           /*  Display string with new lines and tab control codes. Use
  7495.               VerCenter to centralize the string vertically. */
  7496.  
  7497.           WriteWindow(&wd,wd.VerCenter,1,wd.HorSize,W_LEFT,"New lines\n
  7498.                   and\t\tTab control codes are supported...");
  7499.  
  7500.           WaitTime(300);
  7501.  
  7502.           ClearWindow(&wd);
  7503.  
  7504.           /*  This string is longer than window size, it will be clipped */
  7505.  
  7506.           WriteWindow(&wd,wd.VerCenter,22,wd.HorSize,W_LEFT,"This line will
  7507.                   be clipped...");
  7508.  
  7509.           WaitTime(300);
  7510.  
  7511.           /* Remove window from screen */
  7512.  
  7513.           DestroyWindow(&wd);
  7514.           }
  7515.  
  7516.  
  7517.           -----------------------------------------------------------------
  7518.                             Int24ShadowOff, Int24ShadowOn
  7519.           -----------------------------------------------------------------
  7520.           Purpose:    Enable or disable a shadow effect when using the
  7521.                       TrapInt24 function. After any of these functions is
  7522.                       called, all TrapInt24 messages will be displayed with
  7523.                       (or without) a shadow effect.
  7524.  
  7525.           Prototype:  void Int24ShadowOff(void);
  7526.                       void Int24ShadowOn(void);
  7527.  
  7528.           Returns:    Nothing.
  7529.  
  7530.           Parameters: None.
  7531.  
  7532.           See TrapInt24 and SetTrapInt24Colors.
  7533.  
  7534.  
  7535.  
  7536.  
  7537.  
  7538.  
  7539.  
  7540.  
  7541.                     SCL1 Version 3.1 - Reference Manual - Page 122
  7542.  
  7543.  
  7544.  
  7545.  
  7546.  
  7547.  
  7548.  
  7549.                                                             I24_SetUserLang
  7550.           -----------------------------------------------------------------
  7551.                                    I24_SetUserLang
  7552.           -----------------------------------------------------------------
  7553.  
  7554.           Purpose:    Modify the default TrapInt24 error messages with your
  7555.                       own error messages.
  7556.  
  7557.           Prototype:  void I24_SetUserLang(char *prompt1,int offset1,
  7558.                          unsigned int key1,char *prompt2,int offset2,
  7559.                          unsigned int key2,struct ErrorMess *em)
  7560.  
  7561.           Returns:    Nothing
  7562.  
  7563.           Parameters: The error messages are defined in a null terminated
  7564.                       array of structures as follows:
  7565.  
  7566.           struct ErrorMess{
  7567.               int ErrorNum;    Error number of the message to modify.
  7568.  
  7569.               char *Message;   Pointer to the new error message.
  7570.               };
  7571.  
  7572.           The following are the default error messages:
  7573.  
  7574.                   ERROR           DESCRIPTION
  7575.  
  7576.                     0       Write-protected diskette!
  7577.                     2       Drive not ready!
  7578.                     4       CRC Data error
  7579.                     6       Seek error
  7580.                     8       Sector not found
  7581.                     9       Printer out of paper!
  7582.                    10       Write fault
  7583.                    11       Read fault
  7584.                    12       General failure
  7585.                     0       Printer not ready!
  7586.                     0       Unknown Critical Error
  7587.  
  7588.           The following parameters are passed to the function:
  7589.  
  7590.               prompt1 - char pointer to the first prompt ("Retry") action.
  7591.  
  7592.               offset1 - position from the border of the box where to
  7593.               display the first prompt (integer).
  7594.  
  7595.               key1 - key to be used for selecting prompt1 (unsigned int).
  7596.  
  7597.               prompt2 - char pointer to the second prompt ("Cancel")
  7598.               action.
  7599.  
  7600.  
  7601.  
  7602.                     SCL1 Version 3.1 - Reference Manual - Page 123
  7603.  
  7604.  
  7605.  
  7606.  
  7607.  
  7608.  
  7609.  
  7610.                                                  I24_SetUserLang - KeyReady
  7611.  
  7612.               offset2 - position from the border of the box where to
  7613.               display the second prompt (integer).
  7614.  
  7615.               key2 - key to be used for selecting prompt2 (unsigned int).
  7616.  
  7617.               em - pointer to the ErrorMess structure.
  7618.  
  7619.           Example:
  7620.  
  7621.           static struct ErrorMess CtrErrs[]={     /* error code, message */
  7622.               0,"¡Disco protegido!",
  7623.               2,"¡El lector no está listo!",
  7624.               4,"Error de data en disco",
  7625.               6,"Error buscando en disco",
  7626.               8,"Imposible encontrar sector",
  7627.               9,"¡Impresora sin papel!",
  7628.               10,"Error de escritura",
  7629.               11,"Error de lectura",
  7630.               12,"Falla general",
  7631.               0,"¡La impresora no está lista!",
  7632.               0,"Error crítico desconocido",
  7633.               0};
  7634.  
  7635.           I24_SetUserLang("< TRATAR >",6,0x1454,"< CANCELAR
  7636.           >",18,0x2e43,CtrErrs);
  7637.  
  7638.           -----------------------------------------------------------------
  7639.                                        KeyReady
  7640.           -----------------------------------------------------------------
  7641.  
  7642.           Purpose:    Scans the BIOS keyboard buffer for unprocessed
  7643.                       keystrokes.
  7644.  
  7645.           Prototype:  unsigned int KeyReady(void);
  7646.  
  7647.           Returns:    The Scan/Ascii code of key in the BIOS buffer or "0"
  7648.                       if it is empty.
  7649.  
  7650.           Parameters: None
  7651.  
  7652.           Example:
  7653.  
  7654.           #include <scl1.h>
  7655.  
  7656.           main()
  7657.           {
  7658.           while(!KeyReady())
  7659.               printf("No key has been pressed!\n");
  7660.           ClearKeyBuf();
  7661.           }
  7662.  
  7663.                     SCL1 Version 3.1 - Reference Manual - Page 124
  7664.  
  7665.  
  7666.  
  7667.  
  7668.  
  7669.  
  7670.  
  7671.                                                                   KeyStatus
  7672.           -----------------------------------------------------------------
  7673.                                       KeyStatus
  7674.           -----------------------------------------------------------------
  7675.  
  7676.           Purpose:    Returns the shift, control and toggle key status.
  7677.                       Supports extended keyboards if CheckEnhancedKeyb has
  7678.                       been previously called.
  7679.  
  7680.           Prototype:  unsigned char KeyStatus(void);
  7681.  
  7682.           Returns:    The return value AND the following masks, defined in
  7683.                       SCL1KEYS.H, are ">0" if the key is toggled or
  7684.                       pressed.
  7685.  
  7686.                          The mask values for standard keyboards defined in
  7687.                          SCL1KEYS.H are: INSERT, CAPSL, NUML, SCROLL, ALT,
  7688.                          CTRL, LSHIFT and RSHIFT.
  7689.  
  7690.                          The additional mask values for enhanced keyboards
  7691.                          defined in SCL1KEYS.H are: LEFT_CTRL, LEFT_ALT,
  7692.                          RIGHT_CTRL, RIGHT_ALT, SCROLL_DOWN, NUML_DOWN,
  7693.                          CAPSL_DOWN and SYSREQ.
  7694.  
  7695.           Example:
  7696.  
  7697.           #include <scl1.h>
  7698.           #include <scl1keys.h>
  7699.  
  7700.               /* shows the use of the KeyStatus functions */
  7701.  
  7702.           main()
  7703.           {
  7704.           unsigned int KStat,OldKStat;
  7705.  
  7706.           KStat=KeyStatus();
  7707.           do
  7708.               {
  7709.               OldKStat = KStat;
  7710.  
  7711.               if(KStat & ALT)
  7712.                   printf("\n\nALT ON ");
  7713.               else
  7714.                   printf("\n\nALT OFF");
  7715.  
  7716.               if(KStat & LSHIFT || KStat & RSHIFT)
  7717.                   printf("\t\tSHIFT ON ");
  7718.               else
  7719.                   printf("\t\tSHIFT OFF");
  7720.  
  7721.  
  7722.  
  7723.  
  7724.                     SCL1 Version 3.1 - Reference Manual - Page 125
  7725.  
  7726.  
  7727.  
  7728.  
  7729.  
  7730.  
  7731.  
  7732.                                                                   KeyStatus
  7733.  
  7734.               if(KStat & CTRL)
  7735.                   printf("\tCONTROL ON ");
  7736.               else
  7737.                   printf("\tCONTROL OFF");
  7738.  
  7739.               if(KStat & INSERT)
  7740.                   printf("\tINSERT ON ");
  7741.               else
  7742.                   printf("\tINSERT OFF");
  7743.  
  7744.               if(KStat & CAPSL)
  7745.                   printf("\nCAPS LOCK ON ");
  7746.               else
  7747.                   printf("\nCAPS LOCK OFF");
  7748.  
  7749.               if(KStat & NUML)
  7750.                   printf("\tNUM LOCK ON ");
  7751.               else
  7752.                   printf("\tNUM LOCK OFF");
  7753.  
  7754.               if(KStat & SCROLL)
  7755.                   printf("\tSCROLL LOCK ON ");
  7756.               else
  7757.                   printf("\tSCROLL LOCK OFF");
  7758.  
  7759.               printf("\n\nPress any other key to exit\n");
  7760.  
  7761.               do
  7762.                   {
  7763.                   KStat=KeyStatus();
  7764.                   }while(KStat == OldKStat && !KeyReady());
  7765.  
  7766.               if(KeyReady()==INS)
  7767.                   ClearKeyBuf();
  7768.  
  7769.               }while(!KeyReady());
  7770.           ClearKeyBuf();
  7771.           }
  7772.  
  7773.  
  7774.  
  7775.  
  7776.  
  7777.  
  7778.  
  7779.  
  7780.  
  7781.  
  7782.  
  7783.  
  7784.  
  7785.                     SCL1 Version 3.1 - Reference Manual - Page 126
  7786.  
  7787.  
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.                                                                    LeapYear
  7794.           -----------------------------------------------------------------
  7795.                                        LeapYear
  7796.           -----------------------------------------------------------------
  7797.  
  7798.           Purpose:    Determines if a year is leap or not.
  7799.  
  7800.           Prototype:  int LeapYear(int year);
  7801.  
  7802.           Returns:    Returns "1" if the year passed as a parameter is leap
  7803.                       or "0" if it is not leap.
  7804.  
  7805.           Parameter:  year - year in the YYYY format (integer).
  7806.  
  7807.           Example:
  7808.  
  7809.           /* This is the source of the DaysPerMonth function */
  7810.  
  7811.           void DaysPerMonth(year,month)
  7812.           {
  7813.           switch (month)
  7814.               {
  7815.               case 1:
  7816.               case 3:
  7817.               case 5:
  7818.               case 7:
  7819.               case 8:
  7820.               case 10:
  7821.               case 12:
  7822.                   return(31);
  7823.               case 4:
  7824.               case 6:
  7825.               case 9:
  7826.               case 11:
  7827.                   return(30);
  7828.               case 2:
  7829.                   return(28+LeapYear(year));
  7830.               }
  7831.           }
  7832.  
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840.  
  7841.  
  7842.  
  7843.  
  7844.  
  7845.  
  7846.                     SCL1 Version 3.1 - Reference Manual - Page 127
  7847.  
  7848.  
  7849.  
  7850.  
  7851.  
  7852.  
  7853.  
  7854.                                                                  LineEditor
  7855.           -----------------------------------------------------------------
  7856.                                       LineEditor
  7857.           -----------------------------------------------------------------
  7858.  
  7859.           Purpose:    A full featured line editor. You can define most
  7860.                       display parameters such as; where to display a
  7861.                       prompt, size of the field, size of the display,
  7862.                       colors, cursor size, default editing mode, etc.
  7863.  
  7864.           Prototype:  int LineEditor(int Message,LEData *p,...);
  7865.  
  7866.           Returns:    This is a dialog type function. See Appendix "E" for
  7867.                       a description of the general operation of these
  7868.                       functions. Returns a message described in the
  7869.                       Messages section.
  7870.  
  7871.           Parameters: Dialog type functions receive messages and structures
  7872.                       as parameters. The line editor information must be
  7873.                       given in a structure defined as type LEData. The
  7874.                       structure elements are as follows:
  7875.  
  7876.           typedef struct{
  7877.               int PColor;               Color attribute for the prompt.
  7878.  
  7879.               int PRow;                 Row position for the prompt's
  7880.                                         display.
  7881.  
  7882.               int PCol;                 Column position for the prompt's
  7883.                                         display.
  7884.  
  7885.               char *Prompt;             Char pointer to the prompt.
  7886.  
  7887.               int FColor;               Color attribute for the field.
  7888.  
  7889.               int FRow;                 Row position for the field's
  7890.                                         display.
  7891.  
  7892.               int FCol;                 Column position for the field's
  7893.                                         display.
  7894.  
  7895.               unsigned int FLength;     Number of characters to display.
  7896.  
  7897.               unsigned int FSize;       Maximum number of characters of the
  7898.                                         field. If FSize is larger than
  7899.                                         FLength, the display will scroll
  7900.                                         horizontally when the cursor
  7901.                                         reaches the end of the display
  7902.                                         length.
  7903.  
  7904.  
  7905.  
  7906.  
  7907.                     SCL1 Version 3.1 - Reference Manual - Page 128
  7908.  
  7909.  
  7910.  
  7911.  
  7912.  
  7913.  
  7914.  
  7915.                                                                  LineEditor
  7916.  
  7917.               int CType;                Type of characters to be accepted.
  7918.                                         Please refer to  CheckChar for a
  7919.                                         description of the values defined
  7920.                                         in SCL1.H.
  7921.  
  7922.               int MaskFn;               Flag to instruct the function to
  7923.                                         accept or discard the characters
  7924.                                         defined in the MaskArray array. A
  7925.                                         "0" value will accept the
  7926.                                         characters and a "1" value will
  7927.                                         discard them.
  7928.  
  7929.               char *MaskArray;          Array of mask characters (null
  7930.                                         terminated).
  7931.  
  7932.               char *Buffer;             Buffer that holds the information
  7933.                                         to be edited.
  7934.  
  7935.               char *FormatC;            String that holds the characters to
  7936.                                         be used as format characters (such
  7937.                                         as / to delimit date fields, etc.).
  7938.  
  7939.               unsigned int *ExitKeys;   Null terminated array of unsigned
  7940.                                         integer Scan/Ascii values of the
  7941.                                         keys to exit.
  7942.  
  7943.               int InsFlag;              Flag to instruct the function of
  7944.                                         the default edit mode. ("1" =
  7945.                                         Insert, "0" = typeover).
  7946.  
  7947.               int InsertCur;            Size of cursor when insert mode is
  7948.                                         toggled ("0" = none, "1" = normal,
  7949.                                         "2" = block sized).
  7950.  
  7951.               int TypeOverCur;          Size of cursor when typeover mode
  7952.                                         is toggled ("0"= none, "1" =
  7953.                                         normal, "2" = block sized).
  7954.  
  7955.               int CPaint;               Color to be used to mark a group of
  7956.                                         characters from the position
  7957.                                         defined by StartPos to EndPos. The
  7958.                                         CPaint value can be used to
  7959.                                         construct character blocks.
  7960.  
  7961.               unsigned int StartPos;    Start position of conditional
  7962.                                         paint.
  7963.  
  7964.               unsigned int EndPos;      End position of conditional paint.
  7965.  
  7966.               unsigned int EventInfo;   Information about pressed keys.
  7967.  
  7968.                     SCL1 Version 3.1 - Reference Manual - Page 129
  7969.  
  7970.  
  7971.  
  7972.  
  7973.  
  7974.  
  7975.  
  7976.                                                                  LineEditor
  7977.  
  7978.               unsigned int Position;    Contains the current cursor
  7979.                                         position within the buffer (or
  7980.                                         offset).
  7981.  
  7982.               unsigned int Scroll;      Horizontal scroll counter, keeps
  7983.                                         track of the cursor position when
  7984.                                         the field size is larger than the
  7985.                                         field length.
  7986.  
  7987.               int Edited;               Flag that keeps track of the field
  7988.                                         activity.  A value of "0" means
  7989.                                         that the field has not been edited
  7990.                                         and a value of "1" means that the
  7991.                                         field has been edited.
  7992.               }LEData;
  7993.  
  7994.           Messages:
  7995.  
  7996.           Messages that can be sent to the LineEditor function:
  7997.  
  7998.               LE_INIT - Initialize the LEData structure to NULL and sets
  7999.               the following default values:
  8000.  
  8001.                   PColor - set to white characters in a black background or
  8002.                   the normal color set by SetDialogColors.
  8003.  
  8004.                   FColor - set to black characters in a white background or
  8005.                   the reversed color set by SetDialogColors.
  8006.  
  8007.                   FLength and FSize - set to 40 columns.
  8008.  
  8009.                   CType - set to CC_ANY, accept any character.
  8010.  
  8011.                   Buffer - set to use a default internal buffer called
  8012.                   DefBuf.
  8013.  
  8014.                   ExitKeys - set to the default exit keys.
  8015.  
  8016.                   InsFlag - set to the typeover mode.
  8017.  
  8018.                   InsertCur - set to a value of "2".
  8019.  
  8020.               LE_DRAW - display the prompt and current edit buffer's
  8021.               information.
  8022.  
  8023.               LE_UPDATE_FIELD - display the current edit buffer's contents.
  8024.  
  8025.               LE_ACTIVE - edit the contents of the field buffer. The
  8026.               following edit keys have been defined:
  8027.  
  8028.  
  8029.                     SCL1 Version 3.1 - Reference Manual - Page 130
  8030.  
  8031.  
  8032.  
  8033.  
  8034.  
  8035.  
  8036.  
  8037.                                                                  LineEditor
  8038.  
  8039.                          Key                  Action
  8040.  
  8041.                       Left Arrow     cursor one position to the left.
  8042.                       Right Arrow    cursor one position to the right.
  8043.                       END            cursor to end of field.
  8044.                       HOME           cursor to beginning of field.
  8045.                       INSERT         toggle insert mode on/off.
  8046.                       BACKSPACE      erase the character at current cursor
  8047.                                      position. Move remaining text to the
  8048.                                      left.
  8049.                       CTRL+Left      cursor to previous word
  8050.                       CTRL+Right     cursor to next word
  8051.  
  8052.               LE_KEY - the parameter passed with this messages (Scan+Ascii
  8053.               code of the key) is a key value that performs as if the key
  8054.               has been pressed.
  8055.  
  8056.               LE_DATA - the parameter passed with this messages is an ASCII
  8057.               value that performs as if that character has been typed.
  8058.  
  8059.               LE_POSITION_BEGIN - move cursor the start of the edit buffer.
  8060.  
  8061.               LE_POSITION_END - move cursor to the end of the edit buffer.
  8062.  
  8063.               LE_POSITION_UP - move cursor one position forward.
  8064.  
  8065.               LE_POSITION_DOWN - move cursor one position backwards.
  8066.  
  8067.               LE_SET_POSITION - set the cursor position.
  8068.  
  8069.               LE_CHARS_UP - moves all the text from the current cursor
  8070.               position one space forward.
  8071.  
  8072.               LE_CHARS_DOWN - moves all the text in the field from the
  8073.               current cursor position one space backwards.
  8074.  
  8075.               LE_CLEAR - clear the editor's buffer.
  8076.  
  8077.               LE_RESET - when this message is sent the field contents
  8078.               variables are reset to the default value.  If the exit keys
  8079.               have not been defined they are set to the default exit keys.
  8080.  
  8081.           Messages that LineEditor can return:
  8082.  
  8083.               LE_OK - the requested action has been successfully performed.
  8084.  
  8085.               LE_EXIT_KEY - a key defined as an exit key has been pressed.
  8086.  
  8087.               LE_MOUSE_EVENT - the mouse has been clicked after pointing
  8088.               outside the Line Editor field.
  8089.  
  8090.                     SCL1 Version 3.1 - Reference Manual - Page 131
  8091.  
  8092.  
  8093.  
  8094.  
  8095.  
  8096.  
  8097.  
  8098.                                                                  LineEditor
  8099.  
  8100.               LE_BUFFER_END - you have reached the buffer's maximum size.
  8101.  
  8102.               LE_BUFFER_BEGIN - you have reached the beginning of the edit
  8103.               buffer.
  8104.  
  8105.               LE_ILLEGAL_KEY - a key that has not been defined as an exit
  8106.               key or that is not a legal key as defined for that field has
  8107.               been pressed.
  8108.  
  8109.               LE_BUFFER_FULL - the edit buffer is full.
  8110.  
  8111.               LE_ILLEGAL_POSITION - you have requested to move the cursor
  8112.               passed the maximum defined field length or to the left of the
  8113.               beginning position.
  8114.  
  8115.               LE_NEW_POSITION - a legal editing function is performed.
  8116.  
  8117.               LE_MY_MOUSE - response to a LE_CHECK_MOUSE message if the
  8118.               mouse has been clicked after pointing to the field area
  8119.               defined by the function.
  8120.  
  8121.               LE_DEL_NULL - you have pressed the delete key when the cursor
  8122.               has reached the buffer end.
  8123.  
  8124.           Example:
  8125.  
  8126.           #include <scl1.h>
  8127.           #include <scl1keys.h>
  8128.           #include <scl1clor.h>
  8129.  
  8130.            /* Shows the use of LineEditor function. See the example 2 for
  8131.               another example of LineEditor */
  8132.  
  8133.           unsigned int ExitKeys[]={ENTER,ESC,0};
  8134.  
  8135.           main()
  8136.           {
  8137.           LEData led;
  8138.           int Mess;
  8139.           char buffer[81];
  8140.  
  8141.           Cls(WHITE_BLACK,CLS_ALL);               /* clear screen */
  8142.           memset(buffer,0,sizeof(buffer));        /* initialize buffer */
  8143.  
  8144.           /* initialize Line Editor structure */
  8145.  
  8146.           LineEditor(LE_INIT,&led);
  8147.  
  8148.  
  8149.  
  8150.  
  8151.                     SCL1 Version 3.1 - Reference Manual - Page 132
  8152.  
  8153.  
  8154.  
  8155.  
  8156.  
  8157.  
  8158.  
  8159.                                                                  LineEditor
  8160.  
  8161.           /* modify prompt and field position */
  8162.  
  8163.           led.PRow=led.FRow=12;
  8164.           led.PCol=25;
  8165.           led.FCol=35;
  8166.           led.FLength=20;/* the field's screen length is of 20 characters*/
  8167.           led.FSize=80;  /* but up to 80 characters can be entered, the
  8168.                             data entry field will scroll automatically */
  8169.  
  8170.           led.Prompt="Filename:";             /* prompt */
  8171.           led.CType=CC_PATH | CC_CAPITALIZE;  /* type of valid characters*/
  8172.           led.Buffer=buffer;                  /* use our buffer */
  8173.           led.ExitKeys=ExitKeys;              /* our defined exit keys */
  8174.           PushCursor();                       /* save cursor */
  8175.           LineEditor(LE_DRAW,&led);           /* draw */
  8176.  
  8177.           /*  Main loop: send ACTIVE message, LineEditor constantly returns
  8178.               information */
  8179.           do
  8180.               {
  8181.               Mess=LineEditor(LE_ACTIVE,&led);
  8182.               if(Mess==LE_ILLEGAL_KEY)     /* illegal key? */
  8183.                   TSound(440,10);          /* beep */
  8184.  
  8185.               /* loop until an exit key is pressed */
  8186.  
  8187.               }while(Mess != LE_EXIT_KEY);
  8188.           PopCursor();
  8189.           Cls(WHITE_BLACK,CLS_ALL);        /* clear screen */
  8190.           }
  8191.  
  8192.           /****************************************************************
  8193.           #include <scl1.h>
  8194.           #include <scl1keys.h>
  8195.           #include <scl1clor.h>
  8196.  
  8197.            /* Shows the use of LineEditor function using a mask to define
  8198.               acceptable characters. A '@' accepts letters and # accepts
  8199.               digits, * accepts any character. */
  8200.  
  8201.           char mask[]="@@##@"; /* mask to be used */
  8202.  
  8203.           unsigned int ExitKeys[]={ENTER,ESC,0};  /* LineEd exit keys */
  8204.  
  8205.           main()
  8206.           {
  8207.           LEData led;
  8208.           int Mess;
  8209.  
  8210.  
  8211.  
  8212.                     SCL1 Version 3.1 - Reference Manual - Page 133
  8213.  
  8214.  
  8215.  
  8216.  
  8217.  
  8218.  
  8219.  
  8220.                                                                  LineEditor
  8221.  
  8222.           char buffer[6];
  8223.  
  8224.           Cls(WHITE_BLACK,CLS_ALL);               /* clear screen */
  8225.           memset(buffer,0,sizeof(buffer));        /* initialize buffer */
  8226.  
  8227.           /* initialize Line Editor structure */
  8228.  
  8229.           LineEditor(LE_INIT,&led);
  8230.  
  8231.           /* modify prompt and field position */
  8232.  
  8233.           led.FRow=12;
  8234.           led.FCol=35;
  8235.           led.FLength=5; /* the field's screen length is of 5 characters*/
  8236.           led.FSize=5;
  8237.  
  8238.           led.CType=CC_ANY;          /* type of valid characters */
  8239.           led.Buffer=buffer;         /* use our buffer */
  8240.           led.ExitKeys=ExitKeys;     /* our defined exit keys */
  8241.           PushCursor();              /* save cursor */
  8242.           LineEditor(LE_DRAW,&led);  /* draw */
  8243.  
  8244.             /*    Main loop: send ACTIVE message, LineEditor constantly
  8245.                   returns information */
  8246.  
  8247.           do
  8248.               {
  8249.               Mess=LineEditor(LE_ACTIVE,&led);
  8250.               if(Mess==LE_ILLEGAL_KEY)  /* illegal key? */
  8251.                   TSound(440,10);       /* beep */
  8252.  
  8253.               CheckMask(&led);       /* call our function to check mask*/
  8254.  
  8255.               /* loop until an exit key is pressed */
  8256.  
  8257.               }while(Mess != LE_EXIT_KEY);
  8258.  
  8259.           Cls(WHITE_BLACK,CLS_ALL);     /* clear screen */
  8260.           }
  8261.  
  8262.           CheckMask(LEData *led)
  8263.           {
  8264.           int i;
  8265.  
  8266.           /*  each time called this function will check the string in
  8267.               LineEditor and compare it with the mask */
  8268.  
  8269.           i=strlen(led->Buffer)-1;
  8270.  
  8271.  
  8272.  
  8273.                     SCL1 Version 3.1 - Reference Manual - Page 134
  8274.  
  8275.  
  8276.  
  8277.  
  8278.  
  8279.  
  8280.  
  8281.                                                                  LineEditor
  8282.  
  8283.           while(i >= 0)
  8284.               {
  8285.               switch(mask[i])
  8286.                   {         /* digits only */
  8287.                   case '#':
  8288.                       if(!isdigit(led->Buffer[i]))
  8289.                          goto Invalid;
  8290.                       break;
  8291.                   case '@': /* letters only */
  8292.  
  8293.                       if(!isalpha(led->Buffer[i]))
  8294.                          goto Invalid;
  8295.                       break;
  8296.  
  8297.                   case '*': /* accept anything */
  8298.                       return;
  8299.                   }
  8300.               --i;
  8301.               }
  8302.           return;
  8303.  
  8304.           /*  In case an invalid character is detected we'll move
  8305.               LineEditor position to the invalid character. If insert mode
  8306.               is on (InFlag) we'll send the CHARS_DOWN message to
  8307.               LineEditor so that all characters that follow the invalid
  8308.               character are moved down. If insert mode is off we'll copy a
  8309.               space character to the current position. */
  8310.  
  8311.           Invalid:
  8312.               {
  8313.               led->Position=i;
  8314.               if(led->InsFlag)
  8315.                   LineEditor(LE_CHARS_DOWN,led);
  8316.               else
  8317.                   led->Buffer[i]=' ';
  8318.  
  8319.               LineEditor(LE_DRAW,led);  /* redraw */
  8320.               TSound(440,10);
  8321.               }
  8322.           }
  8323.  
  8324.  
  8325.  
  8326.  
  8327.  
  8328.  
  8329.  
  8330.  
  8331.  
  8332.  
  8333.  
  8334.                     SCL1 Version 3.1 - Reference Manual - Page 135
  8335.  
  8336.  
  8337.  
  8338.  
  8339.  
  8340.  
  8341.  
  8342.                                                                  LinkedList
  8343.           -----------------------------------------------------------------
  8344.                                       LinkedList
  8345.           -----------------------------------------------------------------
  8346.  
  8347.           Purpose:    Manages linked lists.
  8348.  
  8349.           Prototype:  int LinkedList(int Mess,LLData *ld,...);
  8350.  
  8351.           Returns:    This is a dialog derived function. See Appendix "E"
  8352.                       for a description of the general operation of these
  8353.                       functions. Returns the messages described in the
  8354.                       Messages section.
  8355.  
  8356.           Parameters: The linked list information is given in structures
  8357.                       type LLData as follows:
  8358.  
  8359.           typedef struct{
  8360.               unsigned int DataSize;    The size of the data block.
  8361.  
  8362.               char *Data;               Pointer to user defined data.
  8363.  
  8364.               unsigned int Nodes;       Variable (internal) that holds the
  8365.                                         quantity of nodes in the list.
  8366.  
  8367.               unsigned int ActiveNode;  Variable (internal) that holds the
  8368.                                         active node number.
  8369.  
  8370.               LLNODE *Head;             Pointer (internal) to the first
  8371.                                         node of the list.
  8372.  
  8373.               LLNODE *Tail;             Pointer (internal) to the last node
  8374.                                         of the list.
  8375.  
  8376.               LLNODE *Position;         Pointer (internal) to the active
  8377.                                         node of the list.
  8378.               }LLData;
  8379.  
  8380.           The structure LLNODEtag can be checked to find out the pointers
  8381.           to the next and previous nodes.  For most applications you will
  8382.           not have to worry about this structure.
  8383.  
  8384.           struct LLNODEtag{
  8385.               struct LLNODEtag *Next;   Pointer to the next list node.
  8386.  
  8387.               struct LLNODEtag *Prev;   Pointer to the previous list node.
  8388.  
  8389.               unsigned int DataSize;    The size of the data block.
  8390.  
  8391.               char *Data;               Pointer to user defined data.
  8392.               }
  8393.  
  8394.  
  8395.                     SCL1 Version 3.1 - Reference Manual - Page 136
  8396.  
  8397.  
  8398.  
  8399.  
  8400.  
  8401.  
  8402.  
  8403.                                                                  LinkedList
  8404.  
  8405.           Messages:
  8406.  
  8407.           The following messages can be sent to LinkedList:
  8408.  
  8409.               LL_INIT - initialize the LLData structure to null.
  8410.  
  8411.               LL_ADD - add a node to the list.
  8412.  
  8413.               LL_NEXT - move to the next node in the list.
  8414.  
  8415.               LL_PREVIOUS - move to the previous node in the list.
  8416.  
  8417.               LL_FIRST - move to the first node in the list.
  8418.  
  8419.               LL_LAST - move to the last node in the list.
  8420.  
  8421.               LL_DELETE - delete a node from the list.
  8422.  
  8423.               LL_DELETE_ALL - delete all nodes.
  8424.  
  8425.               LL_INSERT - insert a node in the list.
  8426.  
  8427.               LL_SET_POSITION - set the node pointer to a desired position.
  8428.  
  8429.               LL_REPLACE - replace a node in the list.
  8430.  
  8431.               LL_SAVE_POSITION  - saves a position in the list for further
  8432.               reference.
  8433.  
  8434.               LL_RESTORE_POSITION - returns to the node previously saved
  8435.               with the LL_SAVE_POSITION message.
  8436.  
  8437.           The following messages can be returned by LinkedList:
  8438.  
  8439.               LL_OK - no errors were found while performing a requested
  8440.               action.
  8441.  
  8442.               LL_MEM_ERROR - there is not enough memory to store the linked
  8443.               list.
  8444.  
  8445.               LL_LAST_NODE - you have reached the last node of the list.
  8446.  
  8447.               LL_FIRST_NODE - you have reached the beginning of the list.
  8448.  
  8449.               LL_EMPTY_LIST - the linked list is empty.
  8450.  
  8451.               LL_ILLEGAL_POSITION - you have requested to move the record
  8452.               pointed to an illegal position.
  8453.  
  8454.  
  8455.  
  8456.                     SCL1 Version 3.1 - Reference Manual - Page 137
  8457.  
  8458.  
  8459.  
  8460.  
  8461.  
  8462.  
  8463.  
  8464.                                                                  LinkedList
  8465.  
  8466.           Example:
  8467.  
  8468.           #include <scl1.h>
  8469.           #include <scl1keys.h>
  8470.           #include <string.h>
  8471.           #include <malloc.h>
  8472.  
  8473.           /*  This example shows the use of the LinkedList to create and
  8474.               manage a linked list */
  8475.  
  8476.           main()
  8477.           {
  8478.           LLData ld;
  8479.           char buffer[20];
  8480.           int i,Mess;
  8481.           unsigned int key=0;
  8482.  
  8483.           InitVideo();
  8484.           LinkedList(LL_INIT,&ld);      /* init */
  8485.  
  8486.               /* add 20 elements to list */
  8487.  
  8488.           for(i=0;i < 20;++i)
  8489.               {
  8490.               sprintf(buffer,"line #%i",i);
  8491.               ld.DataSize=strlen(buffer)+1;   /*  elements can have
  8492.                                                   different sizes */
  8493.               ld.Data=buffer;                 /*  point to our data */
  8494.               LinkedList(LL_ADD,&ld);
  8495.               }
  8496.  
  8497.           LinkedList(LL_FIRST,&ld);           /*  move to first position */
  8498.  
  8499.           printf("%s size:%i\r\n",ld.Data,ld.DataSize);
  8500.  
  8501.           Mess=LL_OK;
  8502.  
  8503.           do
  8504.               {
  8505.               switch(key)            /* translate keystroke to message */
  8506.                   {
  8507.                   case UP:
  8508.                       Mess=LL_PREVIOUS;
  8509.                       break;
  8510.                   case DOWN:
  8511.                       Mess=LL_NEXT;
  8512.                       break;
  8513.                   case HOME:
  8514.                       Mess=LL_FIRST;
  8515.  
  8516.  
  8517.                     SCL1 Version 3.1 - Reference Manual - Page 138
  8518.  
  8519.  
  8520.  
  8521.  
  8522.  
  8523.  
  8524.  
  8525.                                                                  LinkedList
  8526.  
  8527.                       break;
  8528.                   case END:
  8529.                       Mess=LL_LAST;
  8530.                   break;
  8531.                   case INS:
  8532.  
  8533.                   /* let user insert new element */
  8534.  
  8535.                       memset(buffer,0,sizeof(buffer));
  8536.                       if(DialogBox(7,"Text:",0x70,10,CC_ANY,buffer)!=-1)
  8537.                          {
  8538.                          ld.Data=buffer;          /* points to new data */
  8539.                          ld.DataSize=strlen(buffer)+1; /* equals size in    
  8540.                                                           bytes */
  8541.                          Mess=LinkedList(LL_INSERT,&ld);
  8542.                          }
  8543.                       Mess=0;
  8544.                       break;
  8545.                   case DEL:
  8546.                       Mess=LL_DELETE;
  8547.                       break;
  8548.                   case ENTER:
  8549.  
  8550.                   /* let user modify data */
  8551.  
  8552.                       strcpy(buffer,ld.Data);
  8553.                       if(DialogBox(7,"Text:",0x70,10,CC_ANY,buffer)!=-1)
  8554.                          {
  8555.                          ld.Data=buffer;
  8556.                          ld.DataSize=strlen(buffer)+1;
  8557.  
  8558.                          /* replace previous data */
  8559.  
  8560.                          Mess=LinkedList(LL_REPLACE,&ld);
  8561.                          Mess=0;
  8562.                          }
  8563.                       break;
  8564.                   case F2:
  8565.  
  8566.                       /* let user modify position */
  8567.  
  8568.  
  8569.           if(DialogBox(7,"Position:",0x70,10,CC_DIGIT,buffer)!=-1)
  8570.                          Mess=LinkedList(LL_SET_POSITION,&ld,atoi(buffer));
  8571.                       break;
  8572.                   default:
  8573.                       Mess=0;
  8574.                       break;
  8575.                   }
  8576.  
  8577.  
  8578.                     SCL1 Version 3.1 - Reference Manual - Page 139
  8579.  
  8580.  
  8581.  
  8582.  
  8583.  
  8584.  
  8585.  
  8586.                                                    LinkedList - ListManager
  8587.  
  8588.               /* send message to LinkedList */
  8589.  
  8590.               if(Mess)
  8591.                   {
  8592.                   Mess=LinkedList(Mess,&ld);
  8593.  
  8594.                   /*  display data at current position,
  8595.                       ld.Data points to our data
  8596.                       ld.DataSize equals size in byes */
  8597.  
  8598.                   if(Mess!=LL_EMPTY_LIST)
  8599.                       printf("%s size:%i\r\n",ld.Data,ld.DataSize);
  8600.                   else
  8601.                       printf("Empty list\r\n");   /* no data */
  8602.                   }
  8603.               }while((key=GetKey()) != ESC);
  8604.           LinkedList(LL_DELETE_ALL,&ld);
  8605.           }
  8606.  
  8607.  
  8608.           -----------------------------------------------------------------
  8609.                                      ListManager
  8610.           -----------------------------------------------------------------
  8611.  
  8612.           Purpose:    Displays a list of items and permits user selection
  8613.                       of items.
  8614.  
  8615.           Prototype:  int ListManager(int NColor,int RColor,int Number,
  8616.                          int Length,int Selection,int Lines,int Cols,
  8617.                          struct ItemList*p);
  8618.  
  8619.           Returns:    The number of the selected item.
  8620.  
  8621.           Parameters: The Item List message information must be given as an
  8622.                       array of structures as follows:
  8623.  
  8624.           struct ItemList{
  8625.               int Row;      Row position of where to display the item.
  8626.  
  8627.               int Col;      Column position where to display the item.
  8628.  
  8629.               char *String; Char pointer to the item text to be displayed.
  8630.               };
  8631.  
  8632.           The parameters passed to the function are:
  8633.  
  8634.               NColor - color for the normal display of items (integer).
  8635.  
  8636.               RColor - color for the highlighted item (integer).
  8637.  
  8638.  
  8639.                     SCL1 Version 3.1 - Reference Manual - Page 140
  8640.  
  8641.  
  8642.  
  8643.  
  8644.  
  8645.  
  8646.  
  8647.                                                                 ListManager
  8648.  
  8649.               Number - number of items defined (integer).
  8650.  
  8651.               Length - length of the items (integer).
  8652.  
  8653.               Selection - default selection (integer).
  8654.  
  8655.               Lines - number of lines to be displayed (integer).
  8656.  
  8657.               Cols - number of columns to be displayed (integer).
  8658.  
  8659.               ItemList - pointer to the item list structure.
  8660.  
  8661.           Example:
  8662.  
  8663.           #include <scl1.h>
  8664.           #include <scl1clor.h>
  8665.  
  8666.           int Color1=BLACK_WHITE;
  8667.           int Color2=WHITE_BLACK;
  8668.  
  8669.           struct ItemList il[]={
  8670.               10,10,"Item #1",
  8671.               10,20,"Item #2",
  8672.               10,30,"Item #3",
  8673.               12,10,"Item #4",
  8674.               12,20,"Item #5",
  8675.               12,30,"Item #6",
  8676.               };
  8677.  
  8678.           main()
  8679.           {
  8680.           int ItemSelected;
  8681.           ItemSelected=ListManager(Color1,Color2,6,6,1,2,3,il);
  8682.           }
  8683.  
  8684.           See also ListWindow.
  8685.  
  8686.  
  8687.  
  8688.  
  8689.  
  8690.  
  8691.  
  8692.  
  8693.  
  8694.  
  8695.  
  8696.  
  8697.  
  8698.  
  8699.  
  8700.                     SCL1 Version 3.1 - Reference Manual - Page 141
  8701.  
  8702.  
  8703.  
  8704.  
  8705.  
  8706.  
  8707.  
  8708.                                                                  ListWindow
  8709.           -----------------------------------------------------------------
  8710.                                       ListWindow
  8711.           -----------------------------------------------------------------
  8712.  
  8713.           Purpose:    Displays an array of items in a window in columnar
  8714.                       form. The user can use the keyboard or mouse to tag
  8715.                       or select a desired item. For a large list of items,
  8716.                       scroll bars are displayed to indicate that there are
  8717.                       items not shown.
  8718.  
  8719.           Prototype:  int ListWindow(int Message,LWData *p,...);
  8720.  
  8721.           Returns:    This is a dialog type function. See Appendix "E" for
  8722.                       a description of the general operation of these
  8723.                       functions. Returns a message described in the
  8724.                       Messages section.
  8725.  
  8726.           Parameters: Dialog type functions receive messages and structures
  8727.                       as parameters. The list window information is given
  8728.                       in a structure defined as type LWData as follows:
  8729.  
  8730.           typedef struct{
  8731.               int NColor;               Color for normal display.
  8732.  
  8733.               int RColor;               Color for reversed display.
  8734.  
  8735.               int UpperRow;             Upper row position of the window.
  8736.  
  8737.               int LeftCol;              Left column position of the window.
  8738.  
  8739.               int LowerRow;             Lower row position of the window.
  8740.  
  8741.               int RightCol;             Right column position of the
  8742.                                         window.
  8743.  
  8744.               int FrameType;            Frame type as defined in Box.
  8745.  
  8746.               int ScrollBar;            Flag to select drawing scroll bars
  8747.                                         at the bottom of the display.
  8748.  
  8749.               int BarColor;             Color for the scroll bars.
  8750.  
  8751.               char **Array;             Pointer to a null terminated array
  8752.                                         of pointers to be displayed.
  8753.  
  8754.               char *TagArray;           Array that holds which items have
  8755.                                         been tagged. If a null pointer is
  8756.                                         specified no tagging will be
  8757.                                         permitted. Array element values of
  8758.                                         "0" and "1" indicate the status for
  8759.                                         untagged and tagged.
  8760.  
  8761.                     SCL1 Version 3.1 - Reference Manual - Page 142
  8762.  
  8763.  
  8764.  
  8765.  
  8766.  
  8767.  
  8768.  
  8769.                                                                  ListWindow
  8770.  
  8771.               int TagColor;             Color for displaying a tagged item.
  8772.  
  8773.               char *Title;              Char pointer to text to be
  8774.                                         displayed as a window title.
  8775.  
  8776.               int TitleColor;           Color for the title's display.
  8777.  
  8778.               unsigned int *ExitKeys;   Null terminated array of keys to
  8779.                                         exit the function.
  8780.  
  8781.               int StaticWidth;          A value of "0" means that the
  8782.                                         number of columns will be
  8783.                                         determined by the length of the
  8784.                                         items, a value of "1" sets the
  8785.                                         width of the columns to the value
  8786.                                         defined with ColumnWidth.
  8787.  
  8788.               unsigned int Items;       Variable (internal) that holds the
  8789.                                         quantity of items in the array.
  8790.  
  8791.               unsigned int ColumnWidth; Width of each column to be
  8792.                                         displayed.
  8793.  
  8794.               unsigned int FirstItem;   Variable (internal) that holds the
  8795.                                         position of the first array
  8796.                                         element.
  8797.  
  8798.               unsigned int Position;    Variable (internal) that holds the
  8799.                                         active position of the display.
  8800.                                         This element should not be modified
  8801.                                         by the calling program but can be
  8802.                                         read.
  8803.  
  8804.               unsigned int *ExitKeys;   Array of keys to exit the function.
  8805.  
  8806.               int WindowLines;          Number of lines in the List Window
  8807.                                         (used internally).
  8808.  
  8809.               int WindowCols;           Variable (internal) that holds the
  8810.                                         number of columns in the List
  8811.                                         Window.
  8812.  
  8813.               int TotalCols;            Variable (internal) that holds the
  8814.                                         maximum number of columns in the
  8815.                                         window.
  8816.  
  8817.               int TotalWindowItems;     Variable (internal) that holds the
  8818.                                         number of items.
  8819.  
  8820.  
  8821.  
  8822.                     SCL1 Version 3.1 - Reference Manual - Page 143
  8823.  
  8824.  
  8825.  
  8826.  
  8827.  
  8828.  
  8829.  
  8830.                                                                  ListWindow
  8831.  
  8832.               int OldHBlock;            Variable (internal) that holds the
  8833.                                         position of the relative position
  8834.                                         indicating scroll bar block).
  8835.  
  8836.               unsigned int EventInfo;   Information about the keys that
  8837.                                         have been pressed.
  8838.  
  8839.               }LWData;
  8840.  
  8841.           Messages:
  8842.  
  8843.           The following messages can be sent to ListWindow:
  8844.  
  8845.               LW_INIT - initialize the LWData structure to NULL and set the
  8846.               following default values:
  8847.  
  8848.                   NColor - set to white characters in a black background or
  8849.                   the normal color set by SetDialogColors.
  8850.  
  8851.                   RColor - set to black characters in a white background or
  8852.                   the reversed color set by SetDialogColors.
  8853.  
  8854.                   LowerRow and RightCol - one less than the screen length.
  8855.  
  8856.                   FrameType - set to frame type "1" (single line).
  8857.  
  8858.                   ScrollBar - set to draw scroll bars.
  8859.  
  8860.                   BarColor - set to black characters in a white background
  8861.                   or the reversed color set by SetDialogColors.
  8862.  
  8863.                   TagColor - set to black characters in a white background
  8864.                   or the reversed color set by SetDialogColors.
  8865.  
  8866.                   TitleColor - set to white characters in a black
  8867.                   background or the normal color set by SetDialogColors.
  8868.  
  8869.                   OldHBlock - set to "-1".
  8870.  
  8871.               LW_DRAW - display the list window.
  8872.  
  8873.               LW_WRITE - displays the list of items to the screen.
  8874.  
  8875.               LW_ACTIVE - browse through the displayed items and permit the
  8876.               selection or tagging of them using the keyboard as follows:
  8877.  
  8878.  
  8879.  
  8880.  
  8881.  
  8882.  
  8883.                     SCL1 Version 3.1 - Reference Manual - Page 144
  8884.  
  8885.  
  8886.  
  8887.  
  8888.  
  8889.  
  8890.  
  8891.                                                                  ListWindow
  8892.  
  8893.                          Key                  Action
  8894.  
  8895.                       Up Arrow       cursor one item up.
  8896.                       Down Arrow     cursor one item down.
  8897.                       Left Arrow     cursor one item to the left.
  8898.                       Right Arrow    cursor one item to the right.
  8899.                       END            cursor to end of list.
  8900.                       HOME           cursor to beginning of list.
  8901.                       Page Up        cursor one screen up.
  8902.                       Page Down      cursor one screen down.
  8903.  
  8904.               LW_DRAW_BORDER - draw the List Window's border.
  8905.  
  8906.               LW_POSITION_BEGIN - move cursor to the first item.
  8907.  
  8908.               LW_POSITION_END - move cursor to the last item.
  8909.  
  8910.               LW_POSITION_UP - move cursor to the previous item.
  8911.  
  8912.               LW_POSITION_DOWN - move cursor to the next item.
  8913.  
  8914.               LW_SET_POSITION - move cursor to a specific item. The item
  8915.               number is passed as a parameter.
  8916.  
  8917.               LW_CLS - clear the list window data area.
  8918.  
  8919.               LW_CHECK_MOUSE - check if the mouse has been clicked after
  8920.               pointing to the area defined by the function.
  8921.  
  8922.               LW_RESET - reset the position variables to default values. If
  8923.               exit keys have not been defined they are set to the default
  8924.               exit keys.
  8925.  
  8926.               LW_MBAR_CHARS - this message is used to change the characters
  8927.               used for the scroll bars display. Default characters are
  8928.               defined in header file SCL1.H as LW_MBAR_DEF (character for
  8929.               the background) and LW_THUMB_DEF (character to display the
  8930.               relative position). Pass the desired characters as additional
  8931.               parameters (for example, ListWindow(LW_MBAR_CHARS, &swd,
  8932.               LW_MBAR_DEF, 254);).
  8933.  
  8934.           The following messages can be returned by ListWindow:
  8935.  
  8936.               LW_NULL_ARRAY - no item array has been defined.
  8937.  
  8938.               LW_OK - the requested action has been performed.
  8939.  
  8940.               LW_EXIT_KEY - an exit key has been pressed.
  8941.  
  8942.  
  8943.  
  8944.                     SCL1 Version 3.1 - Reference Manual - Page 145
  8945.  
  8946.  
  8947.  
  8948.  
  8949.  
  8950.  
  8951.  
  8952.                                                                  ListWindow
  8953.  
  8954.               LW_MOUSE_EVENT - the mouse has been clicked but it has not
  8955.               been pointed to the area defined by the function.
  8956.  
  8957.               LW_BUFFER_END - you have requested to move the cursor passed
  8958.               the last item.
  8959.  
  8960.               LW_BUFFER_BEGIN - you have requested to move the cursor up
  8961.               passed the first active item.
  8962.  
  8963.               LW_ILLEGAL_KEY - a key that undefined has been pressed.
  8964.  
  8965.               LW_ILLEGAL_POSITION - you have requested to move the cursor
  8966.               to an invalid position.
  8967.  
  8968.               LW_NEW_POSITION - the cursor position has been updated.
  8969.  
  8970.               LW_MOUSE_SELECT - one of the elements have been selected by
  8971.               double clicking the mouse.
  8972.  
  8973.               LW_MY_MOUSE - response to a LW_CHECK_MOUSE message if the
  8974.               mouse has been clicked after pointing to the field area
  8975.               defined by the function.
  8976.  
  8977.               LW_NEW_MOUSEPOS - you have moved the cursor by clicking the
  8978.               mouse after pointing to an item.
  8979.  
  8980.               LW_BLOCK_MARK - you have tagged a group of items using your
  8981.               mouse.
  8982.  
  8983.           Example:
  8984.  
  8985.           #include <scl1.h>
  8986.           #include <scl1clor.h>
  8987.  
  8988.               /* ListWindow example */
  8989.  
  8990.           char *Items[]={   /* Array of items to display */
  8991.               "11111",
  8992.               "22222",
  8993.               "33333",
  8994.               "44444",
  8995.               "55555",
  8996.               "66666",
  8997.               "77777",
  8998.               "88888",
  8999.               "99999",
  9000.               "00000",
  9001.               0,            /* terminated with a "0" */
  9002.               };
  9003.           char TagA[10];
  9004.  
  9005.                     SCL1 Version 3.1 - Reference Manual - Page 146
  9006.  
  9007.  
  9008.  
  9009.  
  9010.  
  9011.  
  9012.  
  9013.                                          ListWindow - LW_MoveTo - SW_MoveTo
  9014.  
  9015.           main()
  9016.           {
  9017.           int EMess;
  9018.           LWData lw;        /* set lw as type LWData */
  9019.  
  9020.           Cls(7,CLS_ALL);
  9021.           ListWindow(LW_INIT,&lw);
  9022.           lw.UpperRow=5;    /* Set window size */
  9023.           lw.LowerRow=9;
  9024.           lw.LeftCol=20;
  9025.           lw.RightCol=34;
  9026.           lw.RColor=WHITE_BLACK+HIGHLIGHT;
  9027.  
  9028.           lw.TagArray=TagA; /* tag array */
  9029.           lw.Array=Items;   /* data */
  9030.  
  9031.           ListWindow(LW_DRAW,&lw);   /* draw */
  9032.           InitMouse(IM_SHOW);
  9033.  
  9034.           do
  9035.               {
  9036.               EMess=ListWindow(LW_ACTIVE,&lw);
  9037.               if(EMess==LW_ILLEGAL_KEY)
  9038.                   LW_MoveTo(&lw);
  9039.               }while(EMess != LW_EXIT_KEY);
  9040.           }
  9041.  
  9042.           -----------------------------------------------------------------
  9043.                                  LW_MoveTo, SW_MoveTo
  9044.           -----------------------------------------------------------------
  9045.  
  9046.           Purpose:    These functions are used with ListWindow (LW_MoveTo)
  9047.                       and ScrollWindow (SW_MoveTo). When ListWindow and
  9048.                       ScrollWindow return an illegal key message, these
  9049.                       functions permit you to move the cursor position to
  9050.                       first item that starts with the Ascii character of
  9051.                       the key pressed.
  9052.  
  9053.           Prototype:  int LW_MoveTo(LWData *lwd);
  9054.                       int SW_MoveTo(SWData *sw);
  9055.  
  9056.           Returns:    Returns the position where the first item that
  9057.                       matches the key pressed is located.
  9058.  
  9059.           Parameters: Each function requires you to specify a pointer to
  9060.                       the corresponding structure, LWData for List and
  9061.                       SWData for ScrollWindow.
  9062.  
  9063.           Example:    See ListWindow and ScrollWindow
  9064.  
  9065.  
  9066.                     SCL1 Version 3.1 - Reference Manual - Page 147
  9067.  
  9068.  
  9069.  
  9070.  
  9071.  
  9072.  
  9073.  
  9074.                                                    MCR_CloseFile - MCR_Init
  9075.           -----------------------------------------------------------------
  9076.                                     MCR_CloseFile
  9077.           -----------------------------------------------------------------
  9078.  
  9079.           Purpose:    Closes a macro file.
  9080.  
  9081.           Prototype:  int MCR_CloseFile(void);
  9082.  
  9083.           Returns:    The DOS error code or "0" if no error occurs. (See
  9084.                       Appendix "A", FILE FUNCTIONS, for more information).
  9085.  
  9086.           Parameters: None
  9087.  
  9088.           Example:    See MCR_Init
  9089.  
  9090.  
  9091.           -----------------------------------------------------------------
  9092.                                        MCR_Init
  9093.           -----------------------------------------------------------------
  9094.  
  9095.           Purpose:    Initialize or start the macro handling process.
  9096.  
  9097.           Prototype:  void MCR_Init(unsigned int Key,int (* userf)
  9098.                          (int flag,MACROData *md));
  9099.  
  9100.           Returns:    Nothing.
  9101.  
  9102.           Parameters:
  9103.  
  9104.               Key - the key that will be used to start or stop the macro
  9105.               definition process (unsigned integer).
  9106.  
  9107.               userf - pointer to a function that will be called when the
  9108.               user selects to start or stop the macro recording process.
  9109.  
  9110.               The user function receives two parameters, an action message
  9111.               (flag) and a pointer to a MACROData structure. The following
  9112.               messages are defined:
  9113.  
  9114.                   MACRO_START - The first time the key defined to record
  9115.                   macros (the Key parameter) is pressed, the user function
  9116.                   receives a MACRO_START message. The user function must
  9117.                   specify the structure that will be assigned to the macro,
  9118.                   the buffer to store the keystrokes and the maximum size.
  9119.                   The size shall be one integer (two bytes) larger than the
  9120.                   maximum macro size. All this information is included in
  9121.                   the MACROData structure.
  9122.  
  9123.  
  9124.  
  9125.  
  9126.  
  9127.                     SCL1 Version 3.1 - Reference Manual - Page 148
  9128.  
  9129.  
  9130.  
  9131.  
  9132.  
  9133.  
  9134.  
  9135.                                                                    MCR_Init
  9136.  
  9137.                   MACRO_STOP - The next time the key defined to start/stop
  9138.                   macros is pressed, the function receives a MACRO_STOP
  9139.                   message. This instructs your user function that the macro
  9140.                   has been recorded. The actual macro size will be stored
  9141.                   in the "size" parameter of the MACROData structure.
  9142.  
  9143.                   Your user function can also receive the MACRO_REPORT or
  9144.                   NO_MACRO messages from the MCR_Report function. The user
  9145.                   function must check these messages and act accordingly.
  9146.                   (Please refer to the MCR_Report function).
  9147.  
  9148.                   The user function must return a value of "0" to indicate
  9149.                   the calling function that no problems have been found in
  9150.                   the macro handling process. If the user function returns
  9151.                   a "-1" the macro will not be recorded.
  9152.  
  9153.           The macro information is stored in a structure type MACROData as
  9154.           follows:
  9155.  
  9156.           typedef struct{
  9157.               unsigned int key;      key to trigger or invoke the macro.
  9158.  
  9159.               unsigned int size;     Maximum number of keys to accept for
  9160.                                      the macro (the macro size).
  9161.  
  9162.               unsigned int *buffer;  Pointer to the buffer that will hold
  9163.                                      the macro, this buffer must be able to
  9164.                                      store one character more than the
  9165.                                      desired number of keys.
  9166.               }MACROData;
  9167.  
  9168.           Example:
  9169.  
  9170.           #include <scl1.h>
  9171.           #include <scl1keys.h>
  9172.           #include <malloc.h>
  9173.  
  9174.           struct ErrorMess em[]={/* Messages for problems creating macros*/
  9175.               1000,"The selected key is\nalready in use.",
  9176.               1001,"Error creating macro file",
  9177.               0};
  9178.  
  9179.           macrof(int mess,MACROData *md); /*  User defined macro processing
  9180.                                               function */
  9181.  
  9182.           main()
  9183.           {
  9184.           LEData led;  /* A LineEditor will be used to get keys */
  9185.           char buffer[81];  /* Buffer for storing keys */
  9186.  
  9187.  
  9188.                     SCL1 Version 3.1 - Reference Manual - Page 149
  9189.  
  9190.  
  9191.  
  9192.  
  9193.  
  9194.  
  9195.  
  9196.                                                                    MCR_Init
  9197.  
  9198.           Cls(7,CLS_ALL);
  9199.           InitUserError(em);
  9200.  
  9201.           memset(buffer,0,sizeof(buffer));
  9202.  
  9203.           LineEditor(LE_INIT,&led);  /* Line Editor initialization */
  9204.           led.Buffer=buffer;
  9205.           led.Prompt="Press F10 to define a macro";
  9206.           led.FRow=1;
  9207.           led.FLength=80;
  9208.           led.FSize=80;
  9209.           LineEditor(LE_DRAW,&led);
  9210.  
  9211.           /*  initialize macros, the parameters needed are: key to
  9212.               start/stop the macro definition and the user defined function
  9213.               that will be called */
  9214.  
  9215.           MCR_Init(F10,macrof);
  9216.  
  9217.           /* Read any macros that might have been stored in file KEYB.MCR*/
  9218.           MCR_ReadFile("KEYB.MCR");
  9219.  
  9220.           /* Activate Line Editor until an Exit Key is pressed */
  9221.           while(LineEditor(LE_ACTIVE,&led) != LE_EXIT_KEY);
  9222.  
  9223.           /*  Before leaving, scan memory for macro functions and report
  9224.               them to the user defined macro handling function*/
  9225.  
  9226.           MCR_Report();
  9227.           }
  9228.  
  9229.           /*  This is the user defined macro handling function, it is
  9230.               called each time a macro recording is started or stopped and
  9231.               by MCR_Report */
  9232.  
  9233.           macrof(int mess,MACROData *md)
  9234.           {
  9235.           unsigned int key;
  9236.  
  9237.           switch(mess)   /* The parameter received is a message from the
  9238.                             macro function */
  9239.               {
  9240.               case MACRO_START:
  9241.               /*  The key defined for starting/stopping the macro recording
  9242.                   process has been pressed for the first time */
  9243.  
  9244.                   /* Place a message on the screen */
  9245.                   MessageOn(0x70,"Enter Macro key...\nPress F10 to end
  9246.                           macro");
  9247.  
  9248.  
  9249.                     SCL1 Version 3.1 - Reference Manual - Page 150
  9250.  
  9251.  
  9252.  
  9253.  
  9254.  
  9255.  
  9256.  
  9257.                                                                    MCR_Init
  9258.  
  9259.                   do
  9260.                       {
  9261.                       key=GetKey();
  9262.  
  9263.                       /* Check if the key is already in use. MCR_MacroExist
  9264.                          returns "1" if that key is already in use */
  9265.  
  9266.                       if(key==F10 || MCR_MacroExist(key))
  9267.                          ErrorBox(1000);
  9268.                       else
  9269.                          break;
  9270.                       }while(1);
  9271.  
  9272.                       /* The MACROData structure holds the macro
  9273.                          information, its elements are:
  9274.                             key - key to trigger macro.
  9275.                             buffer - pointer to the buffer to store keys
  9276.                                      (max keys + 1)
  9277.                             size - max number of keys to accept */
  9278.  
  9279.                   md->key=key;    /* Save key into structure */
  9280.  
  9281.                                /* Allocate memory */
  9282.                   md->buffer=(unsigned int *)calloc(100,sizeof(int));
  9283.  
  9284.                   if(md->buffer==0)
  9285.                       mess=-1;          /* do not record macro */
  9286.                   else
  9287.                       {
  9288.                       mess=0;           /* OK record macro */
  9289.                       md->size=99;      /* set an initial size /
  9290.                       }
  9291.  
  9292.                   MessageOff();
  9293.                   break;
  9294.  
  9295.               case MACRO_STOP:
  9296.               /*  The key defined for starting/stopping the macro recording
  9297.                   process has been pressed for the second time */
  9298.  
  9299.                   md->size = the number of key pressed + 1
  9300.                   use this to resize allocated buffer */
  9301.  
  9302.                   MessageOn(7,"MACRO RECORDED");
  9303.                   WaitTime(100);
  9304.                   MessageOff();
  9305.  
  9306.  
  9307.  
  9308.  
  9309.  
  9310.                     SCL1 Version 3.1 - Reference Manual - Page 151
  9311.  
  9312.  
  9313.  
  9314.  
  9315.  
  9316.  
  9317.  
  9318.                                                                    MCR_Init
  9319.  
  9320.                   md->buffer=realloc(md->buffer,md->size * sizeof(unsigned
  9321.                       int));
  9322.                   mess=0;
  9323.                   break;
  9324.  
  9325.               case MACRO_REPORT:
  9326.  
  9327.                               MCR_Init - MCR_MacroEnable - MCR_MacroDisable
  9328.  
  9329.               /* We have asked for a macro report (call MCR_Report
  9330.               function). Macros will be reported one by one. md holds the
  9331.               macro info*/
  9332.  
  9333.                   if(MCR_SaveMacro("KEYB.MCR",md)) /*  Start saving macros
  9334.                                                        to disk file
  9335.                                                        KEYB.MCR */
  9336.                       {
  9337.                       ErrorBox(1001);
  9338.                       mess=-1;
  9339.                       }
  9340.                   else
  9341.                       mess=0;
  9342.                   break;
  9343.  
  9344.               case MACRO_NO_MACRO:
  9345.  
  9346.               /*  MCR_Report indicates that no more macros could be found
  9347.                   */
  9348.  
  9349.                   if(MCR_CloseFile())
  9350.                       ErrorBox(1001);
  9351.                   mess=0;
  9352.                   break;
  9353.               }
  9354.           return(mess);
  9355.           }
  9356.  
  9357.  
  9358.  
  9359.  
  9360.  
  9361.  
  9362.  
  9363.  
  9364.  
  9365.  
  9366.  
  9367.  
  9368.  
  9369.  
  9370.  
  9371.                     SCL1 Version 3.1 - Reference Manual - Page 152
  9372.  
  9373.  
  9374.  
  9375.  
  9376.  
  9377.  
  9378.  
  9379.                         MCR_MacroEnable - MCR_MacroDisable - MCR_MacroExist
  9380.           -----------------------------------------------------------------
  9381.                           MCR_MacroEnable, MCR_MacroDisable
  9382.           -----------------------------------------------------------------
  9383.  
  9384.           Purpose:    These functions permit the programmer to enable or
  9385.                       disable the macro capabilities. They are useful if
  9386.                       you want to temporarily disable the keyboard macro
  9387.                       trapping while a routine waits for keyboard input,
  9388.                       etc.
  9389.  
  9390.           Prototype:  void MCR_MacroDisable(void);
  9391.                       void MCR_MacroEnable(void);
  9392.  
  9393.           Returns:    Nothing.
  9394.  
  9395.           Parameters: None
  9396.  
  9397.  
  9398.           -----------------------------------------------------------------
  9399.                                     MCR_MacroExist
  9400.           -----------------------------------------------------------------
  9401.  
  9402.           Purpose:    This function verifies if a given keyboard
  9403.                       combination has been previously assigned to a macro.
  9404.  
  9405.           Prototype:  int MacroExist(unsigned int Key);
  9406.  
  9407.           Returns:    Returns "0" if the key has not been assigned to a
  9408.                       macro or "1" if that key has been assigned.
  9409.  
  9410.           Parameter:  Key -  Key to be verified if a macro has already been
  9411.                       assigned (unsigned integer), refer to file
  9412.                       SCL1KEYS.H.
  9413.  
  9414.           Example:    See MCR_Init
  9415.  
  9416.  
  9417.  
  9418.  
  9419.  
  9420.  
  9421.  
  9422.  
  9423.  
  9424.  
  9425.  
  9426.  
  9427.  
  9428.  
  9429.  
  9430.  
  9431.  
  9432.                     SCL1 Version 3.1 - Reference Manual - Page 153
  9433.  
  9434.  
  9435.  
  9436.  
  9437.  
  9438.  
  9439.  
  9440.                                                     MCR_Play - MCR_ReadFile
  9441.           -----------------------------------------------------------------
  9442.                                        MCR_Play
  9443.           -----------------------------------------------------------------
  9444.  
  9445.           Purpose:    This function permits you to play a macro definition.
  9446.  
  9447.           Prototype:  void MCR_Play(unsigned int *macro);
  9448.  
  9449.           Returns:    Nothing
  9450.  
  9451.           Parameter:  macro - pointer to a macro defined as a null
  9452.                       terminated array of scan/ascii codes of the keys.
  9453.  
  9454.           Example:
  9455.  
  9456.           #include <scl1.h>
  9457.           #include <scl1keys.h>
  9458.  
  9459.           /* macro defined as a null terminated array of key scan codes */
  9460.  
  9461.           unsigned int macro1[]={0x1e61,0x3062,0x2e63,0x2064,0};
  9462.  
  9463.           MCR_Play(macro1);  /* ask macro func. to play macro1 */
  9464.  
  9465.  
  9466.           -----------------------------------------------------------------
  9467.                                      MCR_ReadFile
  9468.           -----------------------------------------------------------------
  9469.  
  9470.           Purpose:    Opens a file for retrieving macros.
  9471.  
  9472.           Prototype:  int MCR_ReadFile(char *FileName);
  9473.  
  9474.           Returns:    The DOS error code, "0" if no error occurs or "255"
  9475.                       if there is not enough memory to retrieve the macros
  9476.                       from the file. (See Appendix "A", for more
  9477.                       information).
  9478.  
  9479.           Parameter:  FileName -  char pointer to the filename to be used
  9480.                       for storing or retrieving macros.
  9481.  
  9482.           Example:    See MCR_Init
  9483.  
  9484.  
  9485.  
  9486.  
  9487.  
  9488.  
  9489.  
  9490.  
  9491.  
  9492.  
  9493.                     SCL1 Version 3.1 - Reference Manual - Page 154
  9494.  
  9495.  
  9496.  
  9497.  
  9498.  
  9499.  
  9500.  
  9501.                                              MCR_Record - MCR_RegisterBackF
  9502.  
  9503.           -----------------------------------------------------------------
  9504.                                       MCR_Record
  9505.           -----------------------------------------------------------------
  9506.  
  9507.           Purpose:    This function permits you to start a macro
  9508.                       definition. It offers an alternative to start macro
  9509.                       recording without the use of a hot key, like from a
  9510.                       menu.
  9511.  
  9512.           Prototype:  void MCR_Record(void);
  9513.  
  9514.           Returns:    Nothing
  9515.  
  9516.           Parameters: None
  9517.  
  9518.  
  9519.           -----------------------------------------------------------------
  9520.                                   MCR_RegisterBackF
  9521.           -----------------------------------------------------------------
  9522.  
  9523.           Purpose:    This function permits your program to trap a given
  9524.                       key. The function checks if the key has been pressed
  9525.                       each time there is keyboard activity, and when it
  9526.                       detects that it has been pressed it calls a user
  9527.                       function defined as a parameter.
  9528.  
  9529.           Prototype:  void MCR_RegisterBackF(void(*userf)(void));
  9530.  
  9531.           Returns:    Nothing
  9532.  
  9533.           Parameter:  userf - pointer to an user defined function that will
  9534.                       be called in the background when no keys are being
  9535.                       processed.
  9536.  
  9537.  
  9538.  
  9539.  
  9540.  
  9541.  
  9542.  
  9543.  
  9544.  
  9545.  
  9546.  
  9547.  
  9548.  
  9549.  
  9550.  
  9551.  
  9552.  
  9553.  
  9554.                     SCL1 Version 3.1 - Reference Manual - Page 155
  9555.  
  9556.  
  9557.  
  9558.  
  9559.  
  9560.  
  9561.  
  9562.                                                           MCR_RegisterMacro
  9563.           -----------------------------------------------------------------
  9564.                                   MCR_RegisterMacro
  9565.           -----------------------------------------------------------------
  9566.  
  9567.           Purpose:    This function permits to add a macro. This function
  9568.                       provides an alternate way to add macros to memory.
  9569.  
  9570.           Prototype:  int MCR_RegisterMacro(unsigned int Key,
  9571.                          unsigned int size,unsigned int *Buffer);
  9572.  
  9573.           Returns:    Returns "0" if the macro has been successfully
  9574.                       defined or "1" if there is not sufficient memory to
  9575.                       store the macro.
  9576.  
  9577.           Parameters:
  9578.  
  9579.               key - the key to trigger or invoke the macro (unsigned
  9580.               integer).
  9581.  
  9582.               size - the maximum number of keys to accept for the macro
  9583.               (unsigned integer).
  9584.  
  9585.               buffer - pointer to the buffer that will hold the macro, this
  9586.               buffer must be able to store one character more than the
  9587.               desired number of keys (unsigned integer).
  9588.  
  9589.           Example:
  9590.  
  9591.           unsigned int Macrobuf[]={'M','a','c','r','o',0};
  9592.  
  9593.           MCR_RegisterMacro(CTRLF1,sizeof(Macrobuf),Macrobuf);
  9594.  
  9595.  
  9596.  
  9597.  
  9598.  
  9599.  
  9600.  
  9601.  
  9602.  
  9603.  
  9604.  
  9605.  
  9606.  
  9607.  
  9608.  
  9609.  
  9610.  
  9611.  
  9612.  
  9613.  
  9614.  
  9615.                     SCL1 Version 3.1 - Reference Manual - Page 156
  9616.  
  9617.  
  9618.  
  9619.  
  9620.  
  9621.  
  9622.  
  9623.                                            MCR_RegisterTrapKey - MCR_Report
  9624.           -----------------------------------------------------------------
  9625.                                  MCR_RegisterTrapKey
  9626.           -----------------------------------------------------------------
  9627.  
  9628.           Purpose:    This function permits your program to trap a given
  9629.                       key. The function checks if the key has been pressed
  9630.                       each time there is keyboard activity, and when it
  9631.                       detects that it has been pressed it calls a user
  9632.                       function defined as a parameter.
  9633.  
  9634.           Prototype:  int MCR_RegisterTrapKey(unsigned int Key,
  9635.                          int (* userf)());
  9636.  
  9637.           Returns:    Returns "0" if the key has been successfully trapped
  9638.                       or "1" if there is not enough memory available to
  9639.                       store the information.
  9640.  
  9641.           Parameters:
  9642.  
  9643.               Key -  Key to be trapped (unsigned integer), most keys have
  9644.               been defined in header file SCL1KEYS.H.
  9645.  
  9646.               userf - pointer to an user defined function that will be
  9647.               called every time the trapped key is pressed.
  9648.  
  9649.  
  9650.           -----------------------------------------------------------------
  9651.                                       MCR_Report
  9652.           -----------------------------------------------------------------
  9653.  
  9654.           Purpose:    Scans the memory for defined macros and reports the
  9655.                       macros found to the function that is processing the
  9656.                       macros. Sends a message to the macro user function a
  9657.                       MACRO_REPORT message each time it finds a macro or
  9658.                       MACRO_NO_MACRO when it does not finds any more
  9659.                       macros. Your user function can use this messages to
  9660.                       manage the macros. See example.
  9661.  
  9662.           Prototype:  void ReportMacro(void);
  9663.  
  9664.           Returns:    Nothing
  9665.  
  9666.           Parameters: None
  9667.  
  9668.           Example:    See MCR_Init
  9669.  
  9670.  
  9671.  
  9672.  
  9673.  
  9674.  
  9675.  
  9676.                     SCL1 Version 3.1 - Reference Manual - Page 157
  9677.  
  9678.  
  9679.  
  9680.  
  9681.  
  9682.  
  9683.  
  9684.                                                               MCR_SaveMacro
  9685.           -----------------------------------------------------------------
  9686.                                     MCR_SaveMacro
  9687.           -----------------------------------------------------------------
  9688.  
  9689.           Purpose:    Opens a file, if not open, and saves a macro in
  9690.                       memory to the file.
  9691.  
  9692.           Prototype:  int MCR_SaveMacro(char *FileName,MACROData *md);
  9693.  
  9694.           Returns:    The DOS error code or "0" if no error occurs. (See
  9695.                       Appendix "A", FILE FUNCTIONS, for more information).
  9696.  
  9697.           Parameters: The macro data information is given in a structure
  9698.                       type MACROData as follows:
  9699.  
  9700.           Structure type MACROData;
  9701.  
  9702.           typedef struct{
  9703.               unsigned int key;      Key to trigger or invoke the macro.
  9704.  
  9705.               unsigned int size;     Maximum number of keys to accept for
  9706.                                      the macro.
  9707.  
  9708.               unsigned int *buffer;  Pointer to the buffer that will hold
  9709.                                      the macro, this buffer must be able to
  9710.                                      store one character more than the
  9711.                                      desired number of keys.
  9712.               }MACROData;
  9713.  
  9714.           The parameters passed to the function are:
  9715.  
  9716.               FileName -  pointer to the filename to be used for storing or
  9717.               retrieving macros (char).
  9718.  
  9719.               md - pointer to the MACROData structure.
  9720.  
  9721.           Example:    See MCR_Init
  9722.  
  9723.  
  9724.  
  9725.  
  9726.  
  9727.  
  9728.  
  9729.  
  9730.  
  9731.  
  9732.  
  9733.  
  9734.  
  9735.  
  9736.  
  9737.                     SCL1 Version 3.1 - Reference Manual - Page 158
  9738.  
  9739.  
  9740.  
  9741.  
  9742.  
  9743.  
  9744.  
  9745.           MCR_UnregisterBackF - MCR_UnregisterMacro - MCR_UnregisterTrapKey
  9746.           -----------------------------------------------------------------
  9747.                                  MCR_UnregisterBackF
  9748.           -----------------------------------------------------------------
  9749.  
  9750.           Purpose:    This function permits your program to release a
  9751.                       background function previously defined using the
  9752.                       MCR_RegisterBackF function.
  9753.  
  9754.           Prototype:  void MCR_UnregisterBackF(void);
  9755.  
  9756.           Returns:    Nothing.
  9757.  
  9758.           Parameters: None
  9759.  
  9760.  
  9761.           -----------------------------------------------------------------
  9762.                                  MCR_UnregisterMacro
  9763.           -----------------------------------------------------------------
  9764.  
  9765.           Purpose:    This function permits to remove a previously defined
  9766.                       macro.
  9767.  
  9768.           Prototype:  unsigned int *MCR_UnregisterMacro(unsigned int Key);
  9769.  
  9770.           Returns:    Returns a pointer the macro buffer.
  9771.  
  9772.           Parameter:  key - key assigned to trigger or invoke the macro
  9773.                       (unsigned int).
  9774.  
  9775.  
  9776.           -----------------------------------------------------------------
  9777.                                 MCR_UnregisterTrapKey
  9778.           -----------------------------------------------------------------
  9779.  
  9780.           Purpose:    This function permits your program release trapping
  9781.                       of a given key. The key must have been previously
  9782.                       trapped using the MCR_RegisterTrapKey function.
  9783.  
  9784.           Prototype:  void MCR_UnregisterTrapKey(unsigned int Key);
  9785.  
  9786.           Returns:    Nothing.
  9787.  
  9788.           Parameter:  Key - Key that has been previously trapped (unsigned
  9789.                       int).
  9790.  
  9791.  
  9792.  
  9793.  
  9794.  
  9795.  
  9796.  
  9797.  
  9798.                     SCL1 Version 3.1 - Reference Manual - Page 159
  9799.  
  9800.  
  9801.  
  9802.  
  9803.  
  9804.  
  9805.  
  9806.                                                                     MakeDir
  9807.           -----------------------------------------------------------------
  9808.                                        MakeDir
  9809.           -----------------------------------------------------------------
  9810.  
  9811.           Purpose:    Creates a new directory.
  9812.  
  9813.           Prototype:  int MakeDir(char *Path);
  9814.  
  9815.           Returns:    The DOS error code or "0" if no error occurs.  (See
  9816.                       Appendix "A", FILE FUNCTIONS, for more information).
  9817.  
  9818.  
  9819.           Parameter:  Path - char pointer to a string holding the new
  9820.                       directory name.
  9821.  
  9822.           Example:
  9823.  
  9824.           #include <scl1.h>
  9825.  
  9826.           char Dir[]="SCL1";
  9827.  
  9828.           main()
  9829.           {
  9830.           int i;
  9831.  
  9832.           printf("\nCreating SCL1 directory...\n");
  9833.           i=MakeDir(Dir);
  9834.  
  9835.           if(i)
  9836.               {
  9837.               printf("\nUnable to create directory\n");
  9838.               exit(-1);
  9839.               }
  9840.           else
  9841.               printf("SCL1 directory has been created.\n");
  9842.  
  9843.           printf("\nDeleting SCL1 directory...\n");
  9844.  
  9845.           i=RemoveDir(Dir);
  9846.  
  9847.           if(i)
  9848.               printf("\nUnable to remove directory\n");
  9849.           else
  9850.               printf("SCL1 directory has been deleted.\n");
  9851.           }
  9852.  
  9853.  
  9854.  
  9855.  
  9856.  
  9857.  
  9858.  
  9859.                     SCL1 Version 3.1 - Reference Manual - Page 160
  9860.  
  9861.  
  9862.  
  9863.  
  9864.  
  9865.  
  9866.  
  9867.                                               Menu - MouseMenu - MouseMenu2
  9868.           -----------------------------------------------------------------
  9869.                              Menu, MouseMenu, MouseMenu2
  9870.           -----------------------------------------------------------------
  9871.  
  9872.           Purpose:    Displays a scrolling or moving bar type menu. A
  9873.                       selection is made by either pressing the highlighted
  9874.                       menu option letter or by scrolling the highlighted
  9875.                       bar using the arrow keys and then pressing the ENTER
  9876.                       key. With MouseMenu you can also make a selection by
  9877.                       moving the mouse cursor to the desired line and
  9878.                       clicking the left mouse button.  MouseMenu2 is
  9879.                       identical to MouseMenu but will let you specify a
  9880.                       default selection.
  9881.  
  9882.           Prototype:  int Menu(int NColor,int RColor,int HColor,int NumOpt,
  9883.                          struct MenuOpt *mo);
  9884.  
  9885.                       int MouseMenu(int NColor,int RColor,int HColor,
  9886.                          int NumOpt,struct MenuOpt *k,int XMin,int XMax,
  9887.                          int YMin,int YMax);
  9888.  
  9889.                       int MouseMenu2(int NColor,int RColor,int HColor,
  9890.                          int NumOpt,struct MenuOpt *mo,int XMin,int XMax,
  9891.                          int YMin,int YMax,int StartSel);
  9892.  
  9893.           Returns:    The selection number (>0) or -1 if ESC is pressed.
  9894.  
  9895.           Parameters: The menu information must be entered as an array of
  9896.                       structures as follows; with one array element for
  9897.                       each menu option:
  9898.  
  9899.           struct MenuOpt{
  9900.               int Row;         Row position for the menu item.
  9901.  
  9902.               int Col;         Column position for the menu item.
  9903.  
  9904.               char *String;    Pointer to the menu item text.
  9905.  
  9906.               char Letter;     Letter to be highlighted for fast keyboard
  9907.                                selection of the menu item.
  9908.               };
  9909.  
  9910.           The parameters passed to the function are:
  9911.  
  9912.               NColor - color for the menu background and foreground (int).
  9913.  
  9914.               RColor - color for the highlighted item menu bar (integer).
  9915.  
  9916.               HColor - color for the highlighted quick selection menu item
  9917.               letter (integer).
  9918.  
  9919.  
  9920.                     SCL1 Version 3.1 - Reference Manual - Page 161
  9921.  
  9922.  
  9923.  
  9924.  
  9925.  
  9926.  
  9927.  
  9928.                                               Menu - MouseMenu - MouseMenu2
  9929.  
  9930.               NumOpt - number of menu options (integer).
  9931.  
  9932.               MenuOpt - pointer to the menu structure previously defined.
  9933.  
  9934.           For MouseMenu only;
  9935.  
  9936.               XMin - minimum row position of menu area (integer).
  9937.  
  9938.               XMax - maximum row position of menu area (integer).
  9939.  
  9940.               YMin - minimum column position of menu area (integer).
  9941.  
  9942.               YMax - maximum column position of menu area (integer).
  9943.  
  9944.           For MouseMenu2 only;
  9945.  
  9946.               StartSel - default selection (integer).
  9947.  
  9948.           Example:
  9949.  
  9950.  
  9951.           #include <scl1.h>
  9952.           #include <scl1clor.h>
  9953.  
  9954.           /* Shows the use of Menu, MouseMenu and MouseMenu2 */
  9955.  
  9956.           struct MenuOpt Mainm[7]={/*Array of structures with 7 elements */
  9957.               5,26,"Screen Related Functions    ",'S', /* First option */
  9958.               7,26,"Keyboard Handling Functions ",'K', /* Second option */
  9959.               9,26,"Mouse Handling Functions    ",'M', /* Third option */
  9960.               11,26,"Program Flow Functions      ",'P',/* Fourth option */
  9961.               13,26,"File Handling Functions     ",'F',/* Fifth option */
  9962.               15,26,"Background and Miscellaneous",'B',/* Sixth option */
  9963.               17,26,"Exit Demo                   ",'E',/* Seventh option */
  9964.               };
  9965.  
  9966.           main()
  9967.           {
  9968.           int Selection;
  9969.  
  9970.           Cls(WHITE_BLACK,CLS_ALL);
  9971.           Box(WHITE_BLACK,1,3,24,18,55);               /* Box for menu */
  9972.           WriteScreen(WHITE_BLACK,3,38,"MENU");        /* Menu title */
  9973.  
  9974.           /* Menu */
  9975.  
  9976.           Selection=Menu(WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,7,
  9977.                   Mainm);
  9978.           Cls(WHITE_BLACK,CLS_ALL);
  9979.  
  9980.  
  9981.                     SCL1 Version 3.1 - Reference Manual - Page 162
  9982.  
  9983.  
  9984.  
  9985.  
  9986.  
  9987.  
  9988.  
  9989.                                               Menu - MouseMenu - MouseMenu2
  9990.  
  9991.           if(Selection > 0)
  9992.               printf("You have selected option %i, press any key...\n",
  9993.                   Selection);
  9994.           else
  9995.               printf("You have pressed ESCAPE, press any key...\n");
  9996.  
  9997.           GetKey();
  9998.           InitMouse(IM_SHOW);
  9999.  
  10000.           /* MouseMenu */
  10001.  
  10002.           Cls(WHITE_BLACK,CLS_ALL);
  10003.           Box(WHITE_BLACK,1,3,24,18,55);               /* Box for menu */
  10004.           WriteScreen(WHITE_BLACK,3,35,"MOUSE MENU");  /* Menu title */
  10005.  
  10006.           Selection=MouseMenu(WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+
  10007.                   HIGHLIGHT,7,Mainm,24,55,3,18);
  10008.  
  10009.           Cls(WHITE_BLACK,CLS_ALL);
  10010.           if(Selection > 0)
  10011.               printf("You have selected option %i\n",Selection);
  10012.           else
  10013.               printf("You have pressed ESCAPE or clicked the mouse outside
  10014.                   the menu area.\n");
  10015.           WaitKeyMouse();
  10016.  
  10017.           /*  MouseMenu2 - with MouseMenu2 you can select the option that
  10018.               will be active when the menu first appears (last parameter)*/
  10019.  
  10020.           Cls(WHITE_BLACK,CLS_ALL);
  10021.           Box(WHITE_BLACK,1,3,24,18,55);               /* Box for menu */
  10022.           WriteScreen(WHITE_BLACK,3,35,"MOUSE MENU2 ");/* Menu title */
  10023.  
  10024.           Selection=MouseMenu2(WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+
  10025.                   HIGHLIGHT,7,Mainm,24,55,3,18,3);
  10026.  
  10027.           Cls(WHITE_BLACK,CLS_ALL);
  10028.           if(Selection > 0)
  10029.               printf("You have selected option %i\n",Selection);
  10030.           else
  10031.               printf("You have pressed ESCAPE or clicked the mouse outside
  10032.                   the menu area.\n");
  10033.           }
  10034.  
  10035.  
  10036.  
  10037.  
  10038.  
  10039.  
  10040.  
  10041.  
  10042.                     SCL1 Version 3.1 - Reference Manual - Page 163
  10043.  
  10044.  
  10045.  
  10046.  
  10047.  
  10048.  
  10049.  
  10050.                                                    MenuSystem - MenuSystem2
  10051.           -----------------------------------------------------------------
  10052.                                MenuSystem, MenuSystem2
  10053.           -----------------------------------------------------------------
  10054.  
  10055.           Purpose:    Displays a pull-down menu system. The function
  10056.                       requires to define various structures and data
  10057.                       blocks.  MenuSystem2 is identical to MenuSystem
  10058.                       except that it provides the capability to display a
  10059.                       text string associated with each menu option and of
  10060.                       "greying" out options (making options unavailable
  10061.                       under certain conditions).
  10062.  
  10063.           Prototype:  int MenuSystem(int Message,MSData *msd,...);
  10064.                       int MenuSystem2(int Message,MSData2 *msd,...);
  10065.  
  10066.           Returns:    This are dialog type functions. See Appendix "E" for
  10067.                       a description of the general operation of these
  10068.                       functions. Returns a message described in the
  10069.                       Messages section.
  10070.  
  10071.           Parameters: Dialog type functions receive messages and structures
  10072.                       as parameters. The information is given as follows:
  10073.  
  10074.           1.  The top row menu information is defined as an array of
  10075.               structures type MSBar (for MenuSystem) or MSBar2 (for
  10076.               MenuSystem2) as follows, one element for each of the main
  10077.               options:
  10078.  
  10079.               typedef struct{
  10080.                   int StartCol;      Column position of the first character
  10081.                                      of the option's prompt.
  10082.  
  10083.                   int EndCol;        Column position of the last character
  10084.                                      of the option's prompt.
  10085.  
  10086.                   unsigned int Key;  Key (or combination) that will be used
  10087.                                      to call the pull-down menu. (Necessary
  10088.                                      when using keyboard input).
  10089.  
  10090.                   char *String;      Pointer to a string containing the
  10091.                                      option's prompt.
  10092.                   }MSBar;
  10093.  
  10094.           Notes:
  10095.               A.  The MSBar and MSBar2 structures are identical. Two
  10096.                   different names have been used to prevent confusion.
  10097.  
  10098.               B.  The StartCol and EndCol information is used to determine
  10099.                   the mouse range for that option and to highlight it when
  10100.                   selected. For proper operation make sure that options do
  10101.                   not overlap.
  10102.  
  10103.                     SCL1 Version 3.1 - Reference Manual - Page 164
  10104.  
  10105.  
  10106.  
  10107.  
  10108.  
  10109.  
  10110.  
  10111.                                                    MenuSystem - MenuSystem2
  10112.  
  10113.           2.  Each pull-down menu is defined as an array of structures type
  10114.               MSOptions (for MenuSystem) or MSOptions2 (for MenuSystem2).
  10115.               The structure is similar to that used for the Menu function:
  10116.  
  10117.               typedef struct{
  10118.                   int Row;           Row position for the menu item.
  10119.  
  10120.                   int Col;           Column position for the menu item.
  10121.  
  10122.                   char *String;      Pointer to the menu item text.
  10123.  
  10124.                   char Letter;       Letter to be highlighted for fast
  10125.                                      keyboard selection of the menu item.
  10126.                   }MSOptions;
  10127.  
  10128.  
  10129.               typedef struct{
  10130.                   int Row;           Row position for the menu item.
  10131.  
  10132.                   int Col;           Column position for the menu item.
  10133.  
  10134.                   char *String;      Pointer to the menu item text.
  10135.  
  10136.                   char Letter;       Letter to be highlighted for fast
  10137.                                      keyboard selection of the menu item.
  10138.  
  10139.                   int Active;        Status of the option. "1" makes the
  10140.                                      option available and a "0"
  10141.                                      unavailable.
  10142.  
  10143.                   char *Text;        Pointer to a text string that will be
  10144.                                      displayed when the corresponding menu
  10145.                                      option is highlighted.
  10146.               }MSOptions2;
  10147.  
  10148.           3.  The pull down menu box information is defined in a structure
  10149.               type MSWindows (for MenuSystem) or MSWindow2 (for
  10150.               MenuSystem2), as an array of structures for the menu system,
  10151.               one element for each pull-down menu as follows:
  10152.  
  10153.               typedef struct{
  10154.                   int UpperRow;      Upper row position of the box used to
  10155.                                      enclose the pull-down menu.
  10156.  
  10157.                   int LeftCol;       Left column position of the box.
  10158.  
  10159.                   int LowerRow;      Lower row position of the box.
  10160.  
  10161.                   int RightCol;      Right column position of the box.
  10162.  
  10163.  
  10164.                     SCL1 Version 3.1 - Reference Manual - Page 165
  10165.  
  10166.  
  10167.  
  10168.  
  10169.  
  10170.  
  10171.  
  10172.                                                    MenuSystem - MenuSystem2
  10173.  
  10174.                   int Number;        Number of options in the pull-down
  10175.                                      menu.
  10176.  
  10177.                   char *WinBuffer;   Buffer to store the screen area, used
  10178.                                      when popping out the pull-down menu.
  10179.  
  10180.                   MSOptions *mso;    Pointer to the MSOptions structure
  10181.                                      corresponding to that pull-down menu.
  10182.                   }MSWindow;
  10183.  
  10184.  
  10185.               typedef struct{
  10186.                   int UpperRow;      Refer to the MSWindow structure
  10187.                   int LeftCol;                "             "
  10188.                   int LowerRow;               "             "
  10189.                   int RightCol;               "             "
  10190.                   int Number;                 "             "
  10191.                   char *WinBuffer;            "             "
  10192.  
  10193.                   MSOptions2 *mso;   Pointer to the MSOptions2 structure
  10194.                                      corresponding to that pull-down menu.
  10195.                   }MSWindow2;
  10196.  
  10197.           4.  The remaining information is defined in a structure type
  10198.               MSData (for MenuSystem) or MSData2 (for MenuSystem2) as
  10199.               follows:
  10200.  
  10201.               typedef struct{
  10202.                   int BarNColor;           Normal color for top row or bar
  10203.                                            menu.
  10204.  
  10205.                   int BarRColor;           Reversed color for top row menu.
  10206.  
  10207.                   int MenuNColor;          Normal color for the pull-down
  10208.                                            menus.
  10209.  
  10210.                   int MenuRColor;          Reversed color for the pull-down
  10211.                                            menus.
  10212.  
  10213.                   int MenuHColor;          Highlight color for hot-keys.
  10214.  
  10215.                   MSBar *msb;              Pointer to the MSBar structure.
  10216.  
  10217.                   MSWindow *msw;           Pointer to the MSWindow
  10218.                                            structure.
  10219.  
  10220.                   int Number;              Number of pull-down menus in the
  10221.                                            system.
  10222.  
  10223.  
  10224.  
  10225.                     SCL1 Version 3.1 - Reference Manual - Page 166
  10226.  
  10227.  
  10228.  
  10229.  
  10230.  
  10231.  
  10232.  
  10233.                                                    MenuSystem - MenuSystem2
  10234.  
  10235.                   int Menu;                Holds the active pull-down menu
  10236.                                            number.
  10237.  
  10238.                   int Option;              Holds the active option of the
  10239.                                            selected pull-down menu.
  10240.  
  10241.                   unsigned int EventInfo;  Event information for the Menu
  10242.                                            System.
  10243.                   }MSData;
  10244.  
  10245.  
  10246.               typedef struct{              Refer to the MSData structure
  10247.                   int BarNColor;                  "              "
  10248.                   int BarRColor;                  "              "
  10249.                   int MenuNColor;                 "              "
  10250.                   int MenuRColor;                 "              "
  10251.                   int MenuHColor;                 "              "
  10252.  
  10253.                   int MenuGNColor;         Normal color for the "grayed"
  10254.                                            (unavailable) out menu options.
  10255.  
  10256.                   int MenuGRColor;         Reversed color for the "grayed"
  10257.                                            out menu options.
  10258.  
  10259.                   MSBar2 *msb;             Pointer to the MSBar2 structure.
  10260.  
  10261.                   MSWindow2 *msw;          Pointer to the MSWindow2
  10262.                                            structure.
  10263.  
  10264.                   int Number;              Refer to the MSData structure
  10265.                   int Menu;                       "              "
  10266.                   int Option;                     "              "
  10267.                   unsigned int EventInfo;         "              "
  10268.  
  10269.                   int TextColor;           Color to be used for displaying
  10270.                                            the text related to menu option.
  10271.  
  10272.                   int TextRow;             Row position for displaying the
  10273.                                            text.
  10274.  
  10275.                   int TextCol;             Column position for displaying
  10276.                                            the text.
  10277.  
  10278.                   int TextLength;          Length of the text
  10279.                   }MSData2;
  10280.  
  10281.  
  10282.  
  10283.  
  10284.  
  10285.  
  10286.                     SCL1 Version 3.1 - Reference Manual - Page 167
  10287.  
  10288.  
  10289.  
  10290.  
  10291.  
  10292.  
  10293.  
  10294.                                                    MenuSystem - MenuSystem2
  10295.  
  10296.           Messages:
  10297.  
  10298.           The following messages can be sent to MenuSystem and MenuSystem2:
  10299.  
  10300.               MS_INIT - initialize the MSData structure to NULL and set the
  10301.               following values as follows:
  10302.  
  10303.                   BarNColor - set to black characters in a white background
  10304.                   or the reversed color set by SetDialogColors.
  10305.  
  10306.                   BarRColor - set to white characters in a black background
  10307.                   or the normal color set by SetDialogColors.
  10308.  
  10309.                   MenuNColor - set to white characters in a black
  10310.                   background or the normal color set by SetDialogColors.
  10311.  
  10312.                   MenuRColor - set to black characters in a white
  10313.                   background or the reversed color set by SetDialogColors.
  10314.  
  10315.                   MenuHColor - set to highlighted white characters in a
  10316.                   black background or the highlight color set by
  10317.                   SetDialogColors.
  10318.  
  10319.               MS_DRAW - draw the bar menu.
  10320.  
  10321.               MS_CHECK - checks if any key or mouse event related to the
  10322.               MenuSystem has been activated in which case it will retain
  10323.               control and respond to the following keys:
  10324.  
  10325.                          Key                  Action
  10326.  
  10327.                       Up Arrow       cursor to previous option.
  10328.                       Down Arrow     cursor to next option.
  10329.                       Left Arrow     select previous pull-down menu.
  10330.                       Right Arrow    select next pull-down menu.
  10331.  
  10332.               MS_KEY - the parameter passed with this message (Scan+Ascii
  10333.               code of the key) is a control key value that performs as if
  10334.               the control key has been pressed.
  10335.  
  10336.               MS_SHADOW_ON - turn on a shadow effect for pull-down menus.
  10337.               Make sure to set enough space for the shadow characters in
  10338.               the MSWindows structure.
  10339.  
  10340.               MS_SHADOW_OFF - turn off shadow effect on pull-down menus.
  10341.  
  10342.               MS_LINE_ON - draw horizontal lines on empty spaces inside a
  10343.               menu box.
  10344.  
  10345.  
  10346.  
  10347.                     SCL1 Version 3.1 - Reference Manual - Page 168
  10348.  
  10349.  
  10350.  
  10351.  
  10352.  
  10353.  
  10354.  
  10355.                                                    MenuSystem - MenuSystem2
  10356.  
  10357.               MS_LINE_OFF - do not draw horizontal lines on empty spaces in
  10358.               menu box (default).
  10359.  
  10360.               MS_SET_FRAME_TYPE - sets the frame type for pull down menus
  10361.               to the type specified with an additional parameter (default
  10362.               is single line).
  10363.  
  10364.               MS_SET_BAR_ROW - set the row position where to display the
  10365.               bar menu to the value specified with an additional parameter
  10366.               (default is "0").
  10367.  
  10368.               MS_SET_BAR_START - sets the column position where the bar
  10369.               menu starts to the value specified with an additional
  10370.               parameter (default is "0").
  10371.  
  10372.               MS_SET_BAR_END - sets the column position where the bar menu
  10373.               ends to the value specified with an additional parameter
  10374.               (default is the maximum screen width).
  10375.  
  10376.               MS_SHOW_MENU - enable the display of the menu system.
  10377.  
  10378.               MS_HIDE_MENU - disable the display of the menu system.
  10379.  
  10380.               MS_ALT_ON - set ALT key to bring down pull-down menus.
  10381.  
  10382.               MS_ALT_OFF - disable the ALT key to bring pull-down menus.
  10383.  
  10384.               MS_SET_FRAME_COLOR - set the pull-down menu box's frame
  10385.               color, if this message is not sent it is set to normal color.
  10386.  
  10387.               MS_RESET_FRAME_COLOR - reset the pull-down menu box's frame
  10388.               to normal color.
  10389.  
  10390.               MS_RESET - reset the menu system to the default values.
  10391.  
  10392.           The following messages can be returned by MenuSystem and
  10393.           MenuSystem2:
  10394.  
  10395.               MS_NO_SELECT - no selection has been made.
  10396.  
  10397.               MS_OK - action requested has been successfully performed.
  10398.  
  10399.               MS_SELECT - a selection has been made. This means that the
  10400.               structure element containing the selection information must
  10401.               be checked to determine what has been the selection.
  10402.  
  10403.               MS_CANCEL - the mouse has been clicked after pointing outside
  10404.               the window area or the "ESC" key has been pressed.
  10405.  
  10406.  
  10407.  
  10408.                     SCL1 Version 3.1 - Reference Manual - Page 169
  10409.  
  10410.  
  10411.  
  10412.  
  10413.  
  10414.  
  10415.  
  10416.                                                    MenuSystem - MenuSystem2
  10417.  
  10418.           Example:
  10419.  
  10420.           #include <scl1.h>
  10421.           #include <scl1keys.h>
  10422.           #include <scl1clor.h>
  10423.  
  10424.           /* MenuSystem example  */
  10425.  
  10426.           MSBar msb[]={
  10427.  
  10428.               /*  Menu-bar data:
  10429.                   Start and end column of each option
  10430.                   Menu's key SCAN-ASCII code
  10431.                   String */
  10432.  
  10433.               1,6,0x2100," File ",
  10434.               7,12,0x1200," Edit ",
  10435.               };
  10436.  
  10437.           /*  first pull-down menu
  10438.               row, column position
  10439.               string
  10440.               hot-key */
  10441.  
  10442.           MSOptions mso0[]={
  10443.               2,1," Load ",'L',
  10444.               3,1," Save ",'S',
  10445.               4,1," Quit ",'Q',
  10446.               };
  10447.  
  10448.           /* second pull-down menu */
  10449.  
  10450.           MSOptions mso1[]={
  10451.               2,7," Mark  ",'M',
  10452.               3,7," Cut   ",'C',
  10453.               4,7," Copy  ",'y',
  10454.               5,7," Paste ",'P',
  10455.               };
  10456.  
  10457.           /* buffer for storing pull down menu screen area */
  10458.  
  10459.           char WindowBuf[140];
  10460.  
  10461.           /*  Pull-down menu box & window information
  10462.               top left corner and bottom right corner positions
  10463.               number of options
  10464.               buffer for saving screen area
  10465.               MSOptions structure  */
  10466.  
  10467.  
  10468.  
  10469.                     SCL1 Version 3.1 - Reference Manual - Page 170
  10470.  
  10471.  
  10472.  
  10473.  
  10474.  
  10475.  
  10476.  
  10477.                                                    MenuSystem - MenuSystem2
  10478.  
  10479.           MSWindow msw[]={
  10480.               1,0,5,7,3,WindowBuf,mso0,
  10481.               1,6,6,14,4,WindowBuf,mso1,
  10482.               };
  10483.  
  10484.           /* This structure links all previous structures */
  10485.  
  10486.           MSData msd=
  10487.               {
  10488.               /* bar-menu colors */
  10489.  
  10490.               BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,
  10491.  
  10492.              /* pull-down menu colors */
  10493.  
  10494.               WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,
  10495.  
  10496.               /*  MSBar, MSWindow structures, number of menus and internal
  10497.                   variables */
  10498.  
  10499.               msb,msw,2,0,0,0};
  10500.  
  10501.           main()
  10502.           {
  10503.           int Mess;
  10504.  
  10505.           InitMouse(IM_SHOW); /* initialize mouse */
  10506.  
  10507.           /* Draw shadows */
  10508.  
  10509.           MenuSystem(MS_SHADOW_ON,(MSData *)0);
  10510.  
  10511.           /* MenuSystem will be ALT sensitive */
  10512.  
  10513.           MenuSystem(MS_ALT_ON,(MSData *)0);
  10514.  
  10515.           /* draw */
  10516.  
  10517.           MenuSystem(MS_DRAW,&msd);
  10518.  
  10519.           do
  10520.               {
  10521.  
  10522.               /* a key pressed? */
  10523.  
  10524.               if(Mess=KeyReady())
  10525.                   {
  10526.  
  10527.  
  10528.  
  10529.  
  10530.                     SCL1 Version 3.1 - Reference Manual - Page 171
  10531.  
  10532.  
  10533.  
  10534.  
  10535.  
  10536.  
  10537.  
  10538.                                                    MenuSystem - MenuSystem2
  10539.  
  10540.                   /* send key to MenuSystem */
  10541.  
  10542.                   Mess=MenuSystem(MS_KEY,&msd,Mess);
  10543.  
  10544.               /*  If we still have a key it means it was not a MenuSystem
  10545.                   key, discard key. If your program needs to service the
  10546.                   keyboard you should do it here. */
  10547.  
  10548.                   if(KeyReady())
  10549.                       GetKey();
  10550.                   }
  10551.               else
  10552.  
  10553.               /*  Let MenuSystem check if the mouse has been clicked or a
  10554.                   selection has been made */
  10555.  
  10556.                   Mess=MenuSystem(MS_CHECK,&msd);
  10557.  
  10558.                   if(Mess==MS_SELECT)
  10559.                       {
  10560.  
  10561.                       /* a selection was made, msd.Menu=selected menu */
  10562.  
  10563.                       switch(msd.Menu)
  10564.                          {
  10565.                          case 1:
  10566.  
  10567.                          /* first menu, msd.Option=selected option */
  10568.  
  10569.                             switch(msd.Option)
  10570.                                {
  10571.                                case 1:
  10572.                                   /* first option */
  10573.  
  10574.                                   MessageOn(BLACK_WHITE,"Load");
  10575.                                   WaitTime(100);
  10576.                                   MessageOff();break;
  10577.  
  10578.                                case 2:
  10579.                                   /* second option */
  10580.  
  10581.                                   MessageOn(BLACK_WHITE,"Save");
  10582.                                   WaitTime(100);
  10583.                                   MessageOff();break;
  10584.  
  10585.                                case 3:
  10586.                                   /* third option */
  10587.  
  10588.                                   MessageOn(BLACK_WHITE,"Quit");
  10589.                                   WaitTime(100);
  10590.  
  10591.                     SCL1 Version 3.1 - Reference Manual - Page 172
  10592.  
  10593.  
  10594.  
  10595.  
  10596.  
  10597.  
  10598.  
  10599.                                                    MenuSystem - MenuSystem2
  10600.  
  10601.                                   MessageOff();
  10602.                                   break;
  10603.                                }
  10604.                             break;
  10605.  
  10606.                          case 2:
  10607.  
  10608.                          /* second menu */
  10609.  
  10610.                             switch(msd.Option)
  10611.                                {
  10612.                                case 1:
  10613.                                   /* first option */
  10614.  
  10615.                                   MessageOn(BLACK_WHITE,"Mark");
  10616.                                   WaitTime(100);
  10617.                                   MessageOff();
  10618.                                   break;
  10619.  
  10620.                                case 2:
  10621.                                   /* second option */
  10622.  
  10623.                                   MessageOn(BLACK_WHITE,"Cut");
  10624.                                   WaitTime(100);
  10625.                                   MessageOff();
  10626.                                   break;
  10627.  
  10628.                                case 3:
  10629.                                   /* third option */
  10630.  
  10631.                                   MessageOn(BLACK_WHITE,"Copy");
  10632.                                   WaitTime(100);
  10633.                                   MessageOff();
  10634.                                   break;
  10635.  
  10636.                                case 4:
  10637.                                   /* fourth option */
  10638.  
  10639.                                   MessageOn(BLACK_WHITE,"Paste");
  10640.                                   WaitTime(100);
  10641.                                   MessageOff();
  10642.                                   break;
  10643.                                }
  10644.                                break;
  10645.                          }
  10646.                   }
  10647.               }while(msd.Menu != 1 || msd.Option != 3);
  10648.           }
  10649.  
  10650.  
  10651.  
  10652.                     SCL1 Version 3.1 - Reference Manual - Page 173
  10653.  
  10654.  
  10655.  
  10656.  
  10657.  
  10658.  
  10659.  
  10660.                                                    MenuSystem - MenuSystem2
  10661.  
  10662.           /****************************************************************
  10663.           MenuSystem2 example. You can display a help-line and grayed-out
  10664.           menu items with MenuSystem2  */
  10665.  
  10666.           #include <scl1.h>
  10667.           #include <scl1keys.h>
  10668.           #include <scl1clor.h>
  10669.  
  10670.  
  10671.           MSBar2 msb[]={
  10672.  
  10673.           /* Menu-bar data:
  10674.               Start and end column of each option
  10675.               Menu's key SCAN-ASCII code
  10676.               String */
  10677.  
  10678.               1,6,0x2100," File ",
  10679.               7,12,0x1200," Edit ",
  10680.               };
  10681.  
  10682.           /* first pull-down menu
  10683.               row, column position
  10684.               string
  10685.               hot-key
  10686.               1=active,0=inactive option
  10687.               help text */
  10688.  
  10689.           MSOptions2 mso0[]={
  10690.               2,1," Load ",'L',1,"Load new file",
  10691.               3,1," Save ",'S',0,"Save edited file",   /* inactive option*/
  10692.               4,1," Quit ",'Q',1,"Exit to DOS",
  10693.               };
  10694.  
  10695.           /* second pull-down menu */
  10696.  
  10697.           MSOptions2 mso1[]={
  10698.               2,7," Mark  ",'M',1,"Mark block",
  10699.               3,7," Cut   ",'C',1,"Cut text block",
  10700.               4,7," Copy  ",'y',1,"Copy text block",
  10701.               5,7," Paste ",'P',1,"Paste text block",
  10702.               };
  10703.  
  10704.           /* buffer for storing pull down menu screen area */
  10705.           char WindowBuf[140];
  10706.  
  10707.           /*  Pull-down menu box & window information
  10708.               top left corner and bottom right corner positions
  10709.               number of options
  10710.               buffer for saving screen area
  10711.               MSOptions structure  */
  10712.  
  10713.                     SCL1 Version 3.1 - Reference Manual - Page 174
  10714.  
  10715.  
  10716.  
  10717.  
  10718.  
  10719.  
  10720.  
  10721.                                                    MenuSystem - MenuSystem2
  10722.  
  10723.           MSWindow2 msw[]={
  10724.               1,0,5,7,3,WindowBuf,mso0,
  10725.               1,6,6,14,4,WindowBuf,mso1,
  10726.               };
  10727.  
  10728.           /* This structure links all previous structures */
  10729.  
  10730.           MSData2 msd=
  10731.                {
  10732.              /* bar-menu colors */
  10733.  
  10734.                BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,
  10735.  
  10736.              /* pull-down menu colors */
  10737.  
  10738.                WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,
  10739.  
  10740.               /* normal and reverse color for inactive options */
  10741.  
  10742.                BLACK_BLACK+HIGHLIGHT,BLACK_WHITE+HIGHLIGHT,
  10743.  
  10744.              /*   MSBar, MSWindow structures, number of menus and internal
  10745.                   variables */
  10746.  
  10747.                msb,msw,2,0,0,0,
  10748.  
  10749.                /* text color, line, column, and length */
  10750.  
  10751.                BLACK_WHITE,24,0,80};
  10752.  
  10753.           main()
  10754.           {
  10755.           int Mess;
  10756.  
  10757.           InitMouse(IM_SHOW); /* initialize mouse */
  10758.  
  10759.           /* Draw shadows */
  10760.  
  10761.           MenuSystem2(MS_SHADOW_ON,(MSData *)0);
  10762.  
  10763.           /* MenuSystem2 will be ALT sensitive */
  10764.  
  10765.           MenuSystem2(MS_ALT_ON,(MSData *)0);
  10766.  
  10767.           /* draw */
  10768.  
  10769.           MenuSystem2(MS_DRAW,&msd);
  10770.  
  10771.           do
  10772.  
  10773.  
  10774.                     SCL1 Version 3.1 - Reference Manual - Page 175
  10775.  
  10776.  
  10777.  
  10778.  
  10779.  
  10780.  
  10781.  
  10782.                                                    MenuSystem - MenuSystem2
  10783.  
  10784.                {
  10785.  
  10786.                /* a key pressed? */
  10787.  
  10788.                if(Mess=KeyReady())
  10789.                     {
  10790.  
  10791.                     /* send key to MenuSystem2 */
  10792.  
  10793.                     Mess=MenuSystem2(MS_KEY,&msd,Mess);
  10794.  
  10795.                     /*   If we still have a key it means it was not a
  10796.                          MenuSystem2 key, discard key. If your program
  10797.                          needs to service the keyboard you should do it
  10798.                          here. */
  10799.  
  10800.                     if(KeyReady())
  10801.                          GetKey();
  10802.                     }
  10803.                else
  10804.  
  10805.                     /*   Let MenuSystem2 check if the mouse has been
  10806.                          clicked or a selection has been made */
  10807.  
  10808.                     Mess=MenuSystem2(MS_CHECK,&msd);
  10809.  
  10810.                if(Mess==MS_SELECT)
  10811.                     {
  10812.  
  10813.                     /* a selection was made, msd.Menu=selected menu */
  10814.  
  10815.                     switch(msd.Menu)
  10816.                          {
  10817.                          case 1:
  10818.  
  10819.                          /* first menu, msd.Option=selected option */
  10820.  
  10821.                               switch(msd.Option)
  10822.                                    {
  10823.                                    case 1:
  10824.  
  10825.                                         /* first option */
  10826.  
  10827.                                         MessageOn(BLACK_WHITE,"Load");
  10828.                                         WaitTime(100);
  10829.                                         MessageOff();break;
  10830.  
  10831.  
  10832.  
  10833.  
  10834.  
  10835.                     SCL1 Version 3.1 - Reference Manual - Page 176
  10836.  
  10837.  
  10838.  
  10839.  
  10840.  
  10841.  
  10842.  
  10843.                                                    MenuSystem - MenuSystem2
  10844.  
  10845.                                    case 2:
  10846.  
  10847.                                        /*  second option, since is inactive
  10848.                                            we'll never receive this
  10849.                                            selection*/
  10850.  
  10851.                                        MessageOn(BLACK_WHITE,"Save");
  10852.                                        WaitTime(100);
  10853.                                        MessageOff();break;
  10854.                                 case 3:
  10855.  
  10856.                                     /* third option */
  10857.  
  10858.                                     MessageOn(BLACK_WHITE,"Quit");
  10859.                                     WaitTime(100);
  10860.                                     MessageOff();
  10861.                                     break;
  10862.                                     }
  10863.                             break;
  10864.  
  10865.                          case 2:
  10866.  
  10867.                             /* second menu */
  10868.  
  10869.                             switch(msd.Option)
  10870.                                 {
  10871.                                 case 1:
  10872.                                     /* first option */
  10873.  
  10874.                                     MessageOn(BLACK_WHITE,"Mark");
  10875.                                     WaitTime(100);
  10876.                                     MessageOff();
  10877.                                     break;
  10878.  
  10879.                                 case 2:
  10880.                                     /* second option */
  10881.  
  10882.                                     MessageOn(BLACK_WHITE,"Cut");
  10883.                                     WaitTime(100);
  10884.                                     MessageOff();
  10885.                                     break;
  10886.                                 case 3:
  10887.                                     /* third option */
  10888.  
  10889.                                     MessageOn(BLACK_WHITE,"Copy");
  10890.                                     WaitTime(100);
  10891.                                     MessageOff();
  10892.                                     break;
  10893.  
  10894.  
  10895.  
  10896.                     SCL1 Version 3.1 - Reference Manual - Page 177
  10897.  
  10898.  
  10899.  
  10900.  
  10901.  
  10902.  
  10903.  
  10904.                                 MenuSystem - MenuSystem2 - MESS_SetPosition
  10905.  
  10906.                                 case 4:
  10907.                                     /* fourth option */
  10908.  
  10909.                                     MessageOn(BLACK_WHITE,"Paste");
  10910.                                     WaitTime(100);
  10911.                                     MessageOff();
  10912.                                     break;
  10913.                                 }
  10914.                             break;
  10915.                          }
  10916.                     }
  10917.                }while(msd.Menu != 1 || msd.Option != 3);
  10918.           }
  10919.  
  10920.  
  10921.           -----------------------------------------------------------------
  10922.                                    MESS_SetPosition
  10923.           -----------------------------------------------------------------
  10924.  
  10925.           Purpose:    Permits changing the position of a MessageOn/Off
  10926.                       display to any place in the screen.
  10927.  
  10928.           Prototype:  void MESS_SetPosition(int UpperRow,int LeftCol);
  10929.  
  10930.           Returns:    Nothing
  10931.  
  10932.           Parameters:
  10933.  
  10934.               UpperRow - upper row position of the Message box (integer).
  10935.  
  10936.               LeftCol - left column position of the Message box (integer).
  10937.  
  10938.           Example:    See MessageShadowOn/Off
  10939.  
  10940.  
  10941.  
  10942.  
  10943.  
  10944.  
  10945.  
  10946.  
  10947.  
  10948.  
  10949.  
  10950.  
  10951.  
  10952.  
  10953.  
  10954.  
  10955.  
  10956.  
  10957.                     SCL1 Version 3.1 - Reference Manual - Page 178
  10958.  
  10959.  
  10960.  
  10961.  
  10962.  
  10963.  
  10964.  
  10965.                                                                  MessageOff
  10966.           -----------------------------------------------------------------
  10967.                                       MessageOff
  10968.           -----------------------------------------------------------------
  10969.  
  10970.           Purpose:    Removes the message box displayed by MessageOn and
  10971.                       restores the screen's previous contents.
  10972.  
  10973.           Prototype:  void MessageOff(void);
  10974.  
  10975.           Returns:    Nothing
  10976.  
  10977.           Parameters: None
  10978.  
  10979.           Example:
  10980.  
  10981.           #include <scl1.h>
  10982.           #include <scl1clor.h>
  10983.  
  10984.           main()
  10985.           {
  10986.           int i;
  10987.           char buffer[8];
  10988.           memset(buffer,0,sizeof(buffer));
  10989.           /* display message */
  10990.           MessageOn(WHITE_BLACK,"Counting to 30,000...");
  10991.           for(i=0;i < 30000; i++) /* loop */
  10992.  
  10993.               /* write inside MessageOn screen area */
  10994.               WriteScreen(WHITE_BLACK,11,38,Bin2Ascii((long)i,buffer));
  10995.  
  10996.           MessageOff();  /* restore screen */
  10997.           }
  10998.           See also MessageOn, MessageShadowOff and MessageShadowOn.
  10999.  
  11000.  
  11001.  
  11002.  
  11003.  
  11004.  
  11005.  
  11006.  
  11007.  
  11008.  
  11009.  
  11010.  
  11011.  
  11012.  
  11013.  
  11014.  
  11015.  
  11016.  
  11017.  
  11018.                     SCL1 Version 3.1 - Reference Manual - Page 179
  11019.  
  11020.  
  11021.  
  11022.  
  11023.  
  11024.  
  11025.  
  11026.                              MessageOn - MessageShadowOff - MessageShadowOn
  11027.           -----------------------------------------------------------------
  11028.                                       MessageOn
  11029.           -----------------------------------------------------------------
  11030.  
  11031.           Purpose:    Displays a message inside a box in the center of the
  11032.                       screen. The screen area is saved and is restored when
  11033.                       MessageOff is called.
  11034.  
  11035.           Prototype:  void MessageOn(int Color, char *String);
  11036.  
  11037.           Returns:    Nothing
  11038.  
  11039.           Parameters:
  11040.  
  11041.               Color - Box/message color (integer).
  11042.  
  11043.               String - pointer to string.
  11044.  
  11045.           Note:   Messages are written inside a box. They can have up to 5
  11046.                   lines with up to 40 characters each. Use control
  11047.                   character '\n' to indicate new line. The box will stay on
  11048.                   the screen until MessageOff is called. Each line will be
  11049.                   centered in the window.  Lines will also be centered
  11050.                   vertically. You can call MessageOn as many times as
  11051.                   desired without turning them off with MessageOff. Use
  11052.                   MessageOff to restore the screen with its original
  11053.                   contents before calling the MessageOn for the first time.
  11054.  
  11055.           Example:    See MessageOff
  11056.  
  11057.           See also MessageOff, MessageShadowOff and MessageShadowOn.
  11058.  
  11059.  
  11060.           -----------------------------------------------------------------
  11061.                           MessageShadowOff, MessageShadowOn
  11062.           -----------------------------------------------------------------
  11063.  
  11064.           Purpose:    Displays or disable a shadow effect when using the
  11065.                       MessageOn/MessageOff functions. After any of these
  11066.                       functions are called subsequent calls to the
  11067.                       MessageOn function will be displayed with (or
  11068.                       without) a shadow effect.
  11069.  
  11070.           Prototype:  void MessageShadowOff(void);
  11071.                       void MessageShadowOn(void);
  11072.  
  11073.           Returns:    Nothing.
  11074.  
  11075.           Parameters: None.
  11076.  
  11077.  
  11078.  
  11079.                     SCL1 Version 3.1 - Reference Manual - Page 180
  11080.  
  11081.  
  11082.  
  11083.  
  11084.  
  11085.  
  11086.  
  11087.                                          MessageShadowOff - MessageShadowOn
  11088.  
  11089.           Example:
  11090.  
  11091.           #include <scl1.h>
  11092.           #include <scl1clor.h>
  11093.  
  11094.           main()
  11095.           {
  11096.           int i;
  11097.           /*Clear screen so that shadow effect can be seen */
  11098.           Cls(BLACK_WHITE,CLS_ALL);
  11099.  
  11100.           MESS_SetPosition(4,10);/*Place Message box in row 4, col 10 */
  11101.  
  11102.           MessageOn(WHITE_BLUE,"MessageOn function without
  11103.                                  shadow\nPress any key...");
  11104.           GetKey();
  11105.           MessageOff();
  11106.           MessageShadowOn();
  11107.           MessageOn(WHITE_BLUE,"MessageOn function WITH shadow
  11108.                                  \nPress any key...");
  11109.           GetKey();
  11110.           MessageOff();
  11111.           MessageShadowOff();
  11112.           MessageOn(WHITE_BLUE,"MessageOn function again\nwithout
  11113.                                  shadow\nPress any key...");
  11114.           GetKey();
  11115.           MessageOff();
  11116.           }
  11117.  
  11118.           See MessageOn and MessageOff.
  11119.  
  11120.  
  11121.  
  11122.  
  11123.  
  11124.  
  11125.  
  11126.  
  11127.  
  11128.  
  11129.  
  11130.  
  11131.  
  11132.  
  11133.  
  11134.  
  11135.  
  11136.  
  11137.  
  11138.  
  11139.  
  11140.                     SCL1 Version 3.1 - Reference Manual - Page 181
  11141.  
  11142.  
  11143.  
  11144.  
  11145.  
  11146.  
  11147.  
  11148.                                                               ModifyCharSet
  11149.           -----------------------------------------------------------------
  11150.                                     ModifyCharSet
  11151.           -----------------------------------------------------------------
  11152.  
  11153.           Purpose:    Lets you redefine or modify one or more characters
  11154.                       when using VGA or EGA display adapters. The character
  11155.                       data is passed as a bitmap of 9 X 14 pixels (for
  11156.                       EGA), 9 X 16 pixels (for VGA) or 8 X 8 pixels (for
  11157.                       CGA). Once a character is redefined it can be
  11158.                       displayed using the ASCII code corresponding to that
  11159.                       character.
  11160.  
  11161.                       You can convert small bitmapped drawings into a
  11162.                       series of consecutive characters using the included
  11163.                       BMPCNV.C utility program. The drawing must be saved
  11164.                       using the Windows 3.0 BMP format.  To use the utility
  11165.                       program you must first compile and link it. The
  11166.                       comments on the file explain its usage. This program
  11167.                       may also help to explain how to use the character set
  11168.                       functions.  See Appendix "J".
  11169.  
  11170.           Prototype:  void ModifyCharSet(int Points,int StartCode,
  11171.                          int TotalChars,char *Bits);
  11172.  
  11173.           Returns:    Nothing
  11174.  
  11175.           Parameters:
  11176.  
  11177.               Points - number of scan lines used for the character as per
  11178.               the following table (integer):
  11179.  
  11180.                                   MODE        POINTS
  11181.                                 80 x 25        16
  11182.                       VGA       80 x 28        14
  11183.                                 80 x 50         8
  11184.  
  11185.                       EGA       80 x 25        14
  11186.                                 80 x 43         8
  11187.  
  11188.  
  11189.               StartCode - ASCII code of the first character to modify
  11190.               (integer).
  11191.  
  11192.               TotalChars - number of characters to modify (integer).
  11193.  
  11194.               Bits - pointer to an array that contain a bitmap of the
  11195.               character definition.
  11196.  
  11197.  
  11198.  
  11199.  
  11200.  
  11201.                     SCL1 Version 3.1 - Reference Manual - Page 182
  11202.  
  11203.  
  11204.  
  11205.  
  11206.  
  11207.  
  11208.  
  11209.                                                               ModifyCharSet
  11210.  
  11211.           Example:
  11212.  
  11213.           #include <scl1.h>
  11214.  
  11215.           /*  This file shows the use of GetCharSet and ModifyCharSet to
  11216.               modify VGA and EGA character definition tables */
  11217.  
  11218.           /*  copyright symbol for the VGA */
  11219.  
  11220.           char VGAcopyr[]={0x00,0x00,0x00,0x0f,0x18,0x33,0x26,0x26,0x26,
  11221.                            0x26,0x33,0x18,0x0f,0x00,0x00,0x00,0x00,0x00,
  11222.                            0x00,0xf8,0x0c,0xe6,0x22,0x02,0x02,0x22,0xe6,
  11223.                            0x0c,0xf8,0x00,0x00,0x00};
  11224.  
  11225.           /* copyright symbol for the EGA */
  11226.  
  11227.           char EGAcopyr[]={0x00,0x00,0x0f,0x18,0x33,0x26,0x26,0x26,0x26,
  11228.                            0x33,0x18,0x0f,0x00,0x00,0x00,0x00,0xf8,0x0c,
  11229.                            0xe6,0x22,0x02,0x02,0x22,0xe6,0x0c,0xf8,0x00,
  11230.                            0x00};
  11231.  
  11232.           main()
  11233.           {
  11234.           unsigned char OldChar[32 * 2]; /* Buffer */
  11235.  
  11236.           VideoConfig();
  11237.           if(VC_Monitor != VC_VGA && VC_Monitor != VC_EGA)
  11238.               {
  11239.               printf("Your monitor does not support character
  11240.                       modification\n");
  11241.               exit(-1);
  11242.               }
  11243.  
  11244.           /*  We will change ASCII characters 192-193 into a copyright
  11245.               symbol but first we'll copy the original characters so that
  11246.               they can be restored later */
  11247.  
  11248.           GetCharSet(192,2,OldChar);
  11249.  
  11250.           /*  Modify character definition */
  11251.  
  11252.           if(VC_Monitor==VC_VGA)
  11253.  
  11254.               ModifyCharSet(16,192,2,VGAcopyr);
  11255.  
  11256.           else
  11257.  
  11258.               ModifyCharSet(14,192,2,EGAcopyr);
  11259.  
  11260.  
  11261.  
  11262.                     SCL1 Version 3.1 - Reference Manual - Page 183
  11263.  
  11264.  
  11265.  
  11266.  
  11267.  
  11268.  
  11269.  
  11270.                                               ModifyCharSet - ModifyPalette
  11271.  
  11272.           /*  Write the new copyright character */
  11273.  
  11274.           printf("The new copyright symbol \xc0\xc1, press any key...\n");
  11275.  
  11276.           WaitKeyMouse();
  11277.  
  11278.           /* restore characters */
  11279.  
  11280.           ModifyCharSet(32,192,2,OldChar);
  11281.  
  11282.           printf("Symbols restored\n");
  11283.           }
  11284.  
  11285.  
  11286.           -----------------------------------------------------------------
  11287.                                     ModifyPalette
  11288.           -----------------------------------------------------------------
  11289.  
  11290.           Purpose:    Modify all palette colors.  The color array contains
  11291.                       seventeen values, 16 colors and the screen border
  11292.                       color.  See Appendix "J".
  11293.  
  11294.           Prototype:  void ModifyPalette(char *Colors);
  11295.  
  11296.           Returns:    Nothing
  11297.  
  11298.           Parameters:
  11299.  
  11300.               Colors - Char pointer to an array of new colors containing 17
  11301.               values, 16 colors and the border color.
  11302.  
  11303.  
  11304.  
  11305.  
  11306.  
  11307.  
  11308.  
  11309.  
  11310.  
  11311.  
  11312.  
  11313.  
  11314.  
  11315.  
  11316.  
  11317.  
  11318.  
  11319.  
  11320.  
  11321.  
  11322.  
  11323.                     SCL1 Version 3.1 - Reference Manual - Page 184
  11324.  
  11325.  
  11326.  
  11327.  
  11328.  
  11329.  
  11330.  
  11331.                                                          ModifyPaletteColor
  11332.           -----------------------------------------------------------------
  11333.                                   ModifyPaletteColor
  11334.           -----------------------------------------------------------------
  11335.  
  11336.           Purpose:    Modifies one palette entry.  See Appendix "J".
  11337.  
  11338.           Prototype:  void ModifyPaletteColor(int Palette,int NewValue);
  11339.  
  11340.           Returns:    Nothing
  11341.  
  11342.           Parameters:
  11343.  
  11344.               Palette - palette number (integer).
  11345.  
  11346.               NewValue - new color (integer).
  11347.  
  11348.           Example:
  11349.  
  11350.           #include <scl1.h>
  11351.           #include <scl1keys.h>
  11352.  
  11353.           /*  This file shows how to use ModifyPaletteColor to change
  11354.               palette settings in a VGA or EGA monitor */
  11355.  
  11356.           static char PaldemoText1[]="   Up/Down arrow keys - modify
  11357.                                      background color  background color:\n"
  11358.                                      "Left/Right arrow keys - modify
  11359.                                       foreground color  foreground color:";
  11360.  
  11361.           static char PaldemoText2[]="ESC to\n EXIT";
  11362.  
  11363.           main()
  11364.           {
  11365.           int bcolor=0,fcolor=7;
  11366.           char buffer[12];
  11367.           unsigned int key;
  11368.  
  11369.           /*  We Will modify palette entry 0 (normally black) and palette
  11370.               entry 7 (white) */
  11371.  
  11372.           InitVideo();
  11373.           FillBlock(7,0,0,22,79,'X');         /* fill screen */
  11374.           WriteScreen(7,23,0,PaldemoText1);   /* write message */
  11375.           WriteScreen(7,23,73,PaldemoText2);
  11376.  
  11377.           do
  11378.               {
  11379.  
  11380.  
  11381.  
  11382.  
  11383.  
  11384.                     SCL1 Version 3.1 - Reference Manual - Page 185
  11385.  
  11386.  
  11387.  
  11388.  
  11389.  
  11390.  
  11391.  
  11392.                                                          ModifyPaletteColor
  11393.  
  11394.               /* write palette entry values */
  11395.  
  11396.               sprintf(buffer,"0x%02x\n0x%02x",bcolor,fcolor);
  11397.               WriteScreen(7,23,67,buffer);
  11398.  
  11399.               switch((key=GetKey()))
  11400.                   {
  11401.                   case UP:        /* let user modify value with keyboard */
  11402.                       if(bcolor < 63)
  11403.                          {
  11404.                          ++bcolor;
  11405.                          ModifyPaletteColor(0,bcolor); /* modify palette */
  11406.                          }
  11407.                       break;
  11408.                   case DOWN:
  11409.                       if(bcolor > 0)
  11410.                          {
  11411.                          --bcolor;
  11412.                          ModifyPaletteColor(0,bcolor);
  11413.                          }
  11414.                       break;
  11415.                   case RIGHT:
  11416.                       if(fcolor < 63)
  11417.                          {
  11418.                          ++fcolor;
  11419.                          ModifyPaletteColor(7,fcolor);
  11420.                          }
  11421.                          break;
  11422.                   case LEFT:
  11423.                       if(fcolor > 0)
  11424.                          {
  11425.                          --fcolor;
  11426.                          ModifyPaletteColor(7,fcolor);
  11427.                          }
  11428.                       break;
  11429.                   }
  11430.               }while(key != ESC);
  11431.           InitVideo();         /* restore to default */
  11432.           }
  11433.  
  11434.  
  11435.  
  11436.  
  11437.  
  11438.  
  11439.  
  11440.  
  11441.  
  11442.  
  11443.  
  11444.  
  11445.                     SCL1 Version 3.1 - Reference Manual - Page 186
  11446.  
  11447.  
  11448.  
  11449.  
  11450.  
  11451.  
  11452.  
  11453.                                                                 MouseButton
  11454.           -----------------------------------------------------------------
  11455.                                      MouseButton
  11456.           -----------------------------------------------------------------
  11457.  
  11458.           Purpose:    A Mouse Button is a prompt that can be placed
  11459.                       anywhere in the screen, that when pointed and clicked
  11460.                       by the mouse performs a given action. It performs as
  11461.                       a sensitive screen prompt. The selected button is
  11462.                       drawn in the specified color with or without a box.
  11463.                       Most functions, like FileBox, use Mouse Buttons (to
  11464.                       select or cancel). If you require more than one Mouse
  11465.                       Button it is better to use Fields2.
  11466.  
  11467.           Prototype:  int MouseButton(int Message,MBData *p);
  11468.  
  11469.           Returns:    This is a dialog type function. See Appendix "E" for
  11470.                       a description of the general operation of these
  11471.                       functions. Returns a message described in the
  11472.                       Messages section.
  11473.  
  11474.           Parameters: Dialog type functions receive messages and structures
  11475.                       as parameters. The MouseButton information must be
  11476.                       given in a structure, type MBData, as follows:
  11477.  
  11478.           typedef struct{
  11479.               int NColor;               Color used for an unselected
  11480.                                         button.
  11481.  
  11482.               int RColor;               Color used for a selected button.
  11483.  
  11484.               int UpperRow;             Upper row position of the Button
  11485.                                         area.
  11486.  
  11487.               int LeftCol;              Left column position of the Button
  11488.                                         area.
  11489.  
  11490.               int LowerRow;             Lower row position of the Button
  11491.                                         area.
  11492.  
  11493.               int RightCol;             Right column position of the Button
  11494.                                         area.
  11495.  
  11496.               int PRow;                 Row position of the Mouse Button
  11497.                                         text.
  11498.  
  11499.               int PCol;                 Column position of the Button text.
  11500.  
  11501.               char *Prompt;             Char pointer to the Mouse Button
  11502.                                         text.
  11503.  
  11504.  
  11505.  
  11506.                     SCL1 Version 3.1 - Reference Manual - Page 187
  11507.  
  11508.  
  11509.  
  11510.  
  11511.  
  11512.  
  11513.  
  11514.                                                                 MouseButton
  11515.  
  11516.               int BoxFlag;              Flag to indicate if a box shall be
  11517.                                         drawn around a Mouse Button.
  11518.  
  11519.               int ActiveFlag;           Flag to indicate if the Button is
  11520.                                         active.
  11521.  
  11522.               unsigned int *ExitKeys;   Array of keys to exit the function.
  11523.  
  11524.               unsigned int EventInfo;   Holds the key pressed when you exit
  11525.                                         the function or a non defined key
  11526.                                         is pressed.
  11527.               }MBData;
  11528.  
  11529.           Messages:
  11530.  
  11531.           The following messages can be sent to MouseButton:
  11532.  
  11533.               MB_INIT - initialize the MBData structure to NULL and set the
  11534.               following default values:
  11535.  
  11536.                   NColor - white characters in a black background or the
  11537.                   normal color set by SetDialogColors.
  11538.  
  11539.                   RColor - black characters in a white background or the
  11540.                   reversed color set by SetDialogColors.
  11541.  
  11542.               MB_DRAW - display the Mouse Button.
  11543.  
  11544.               MB_ACTIVE - move the cursor to the Mouse Button.  This
  11545.               message is used by the Fields2 function.
  11546.  
  11547.               MB_CHECK_MOUSE - check to see if the mouse has been clicked
  11548.               after pointing to the Mouse Button.
  11549.  
  11550.               MB_RESET - reset the Mouse Button variables to the default
  11551.               values. If exit keys have not been defined, set to the
  11552.               default exit keys.
  11553.  
  11554.           The following messages can be returned by MouseButton:
  11555.  
  11556.               MB_OK - the function has performed the requested action.
  11557.  
  11558.               MB_EXIT_KEY - an exit key has been pressed.
  11559.  
  11560.               MB_MOUSE_EVENT - the mouse has been clicked after pointing
  11561.               outside the area defined by the function.
  11562.  
  11563.               MB_ILLEGAL_KEY - a key that has not been defined has been
  11564.               pressed.
  11565.  
  11566.  
  11567.                     SCL1 Version 3.1 - Reference Manual - Page 188
  11568.  
  11569.  
  11570.  
  11571.  
  11572.  
  11573.  
  11574.  
  11575.                                                    MouseButton - MoveFilePt
  11576.  
  11577.               MB_MOUSE_SELECT - you have clicked your mouse after pointing
  11578.               to the Mouse Button.
  11579.  
  11580.               MB_MY_MOUSE - response to a MB_CHECK_MOUSE message if the
  11581.               mouse has been clicked after pointing to the area defined.
  11582.  
  11583.           Example:
  11584.  
  11585.           #include <scl1.h>
  11586.           #include <scl1clor.h>
  11587.  
  11588.           main()
  11589.           {
  11590.           int EMess;
  11591.           MBData mb1;
  11592.           Cls(WHITE_BLACK,CLS_ALL);
  11593.           MouseButton(MB_INIT,&mb1);
  11594.           mb1.LeftCol=12;
  11595.           mb1.RightCol=19;
  11596.           mb1.NColor=WHITE_BLACK;
  11597.           mb1.RColor=BLACK_WHITE;
  11598.           mb1.UpperRow=6;
  11599.           mb1.Prompt="< LOAD >";;
  11600.           MouseButton(MB_DRAW,&mb1);
  11601.           do
  11602.               {
  11603.               EMess=MouseButton(MB_ACTIVE,&mb1);
  11604.               }while(EMess != MB_EXIT_KEY && EMess != MB_MOUSE_SELECT);
  11605.           }
  11606.  
  11607.           -----------------------------------------------------------------
  11608.                                       MoveFilePt
  11609.           -----------------------------------------------------------------
  11610.  
  11611.           Purpose:    Moves the file pointer to the current location plus
  11612.                       an offset.
  11613.  
  11614.           Prototype:  int MoveFilePt(int Handle, unsigned long Bytes);
  11615.  
  11616.           Returns:    The DOS error code or "0" if no error occurs.  (See
  11617.                       Appendix "A").
  11618.  
  11619.           Parameters:
  11620.  
  11621.               Handle - number is given by DOS when you open a file
  11622.               (integer).
  11623.  
  11624.               Bytes - number of bytes for offset (unsigned long integer).
  11625.  
  11626.           Example:    See GetFilePt
  11627.  
  11628.                     SCL1 Version 3.1 - Reference Manual - Page 189
  11629.  
  11630.  
  11631.  
  11632.  
  11633.  
  11634.  
  11635.  
  11636.                                                MoveFilePt2Offset - Num2Date
  11637.           -----------------------------------------------------------------
  11638.                                   MoveFilePt2Offset
  11639.           -----------------------------------------------------------------
  11640.  
  11641.           Purpose:    Moves the file read write pointer to an offset from
  11642.                       the beginning of the file.
  11643.  
  11644.           Prototype:  int MoveFilePt2Offset(int Handle, unsigned long
  11645.                       Bytes);
  11646.  
  11647.           Returns:    The return value is 0 if no error occur or the DOS
  11648.                       error code if an error occur. (See Appendix "A")
  11649.  
  11650.           Parameters:
  11651.  
  11652.               Handle - number is given by DOS when you open a file (int).
  11653.  
  11654.               Bytes - number of bytes for offset (unsigned long integer).
  11655.  
  11656.           Example:    See GetFilePt
  11657.  
  11658.           -----------------------------------------------------------------
  11659.                                        Num2Date
  11660.           -----------------------------------------------------------------
  11661.  
  11662.           Purpose:    Converts an unsigned integer number representing the
  11663.                       number of elapsed days since January 1, 1900 to the
  11664.                       Day/Month/Year/WeekDay format.
  11665.  
  11666.           Prototype:  void Num2Date(unsigned int count,int *Month,int *Day,
  11667.                          int *Year, int *Weekday)
  11668.  
  11669.           Returns:    modifies the variables that holds the date
  11670.                       information.
  11671.  
  11672.           Parameters:
  11673.  
  11674.               count - unsigned integer number representing the number of
  11675.               days that have elapsed since January 1, 1900.
  11676.  
  11677.               Month - a valid month number (1 to 28,29, 30 or 31)(integer).
  11678.  
  11679.               Day - a valid month number (1 to 12) (integer).
  11680.  
  11681.               Year - a valid month year (four digits) from 1900 to 2077
  11682.               (int).
  11683.  
  11684.               WeekDay - an integer representing the day of the week
  11685.               (0=Sunday, etc.)
  11686.  
  11687.           Example:    See Date2Num
  11688.  
  11689.                     SCL1 Version 3.1 - Reference Manual - Page 190
  11690.  
  11691.  
  11692.  
  11693.  
  11694.  
  11695.  
  11696.  
  11697.                                                                    OpenFile
  11698.           -----------------------------------------------------------------
  11699.                                        OpenFile
  11700.           -----------------------------------------------------------------
  11701.  
  11702.           Purpose:    Opens and existing file.
  11703.  
  11704.           Prototype:  int OpenFile(char *Filename, int *Handle,char OMode);
  11705.  
  11706.           Returns:    The DOS error code or "0" if no error occurs.  (See
  11707.                       Appendix "A", FILE FUNCTIONS, for more information).
  11708.  
  11709.           Parameters:
  11710.  
  11711.               Filename - pointer to filename (char).
  11712.  
  11713.               Handle - pointer to variable that will hold the DOS handle
  11714.               number (int).
  11715.  
  11716.               OMode - One of several Open modes as defined in SCL1.H:
  11717.  
  11718.                   DOS2_READ    -  For reading only.
  11719.                   DOS2_WRITE   -  For writing.
  11720.                   DOS2_RW      -  For reading and writing.
  11721.               Any of these modes can be used with DOS 2.0 or higher.
  11722.  
  11723.               The following can only be used with DOS 3.0 and higher. Here,
  11724.               the Open Mode parameter is composed of three parts: the
  11725.               Inheritance Flag, that determines if child processes will
  11726.               inherit open files; the Sharing Mode, that determines if file
  11727.               can be shared by several processes; and the Access Mode that
  11728.               is similar to DOS 2.0 Open Mode. You must add the three flags
  11729.               to get the desired open mode.
  11730.  
  11731.                       Inheritance Flag:
  11732.  
  11733.                       DOS3_INHERIT   -  Child process inherit open files.
  11734.                       DOS3_PRIVATE   -  No inheritance.
  11735.  
  11736.                       Sharing mode:
  11737.  
  11738.                       DOS3_COMP      -  Compatible with DOS 2.0
  11739.                       DOS3_DENY_RW   -  Deny read or write to other
  11740.                                         processes.
  11741.                       DOS3_DENY_W    -  Deny write.
  11742.                       DOS3_DENY_R    -  Deny read.
  11743.                       DOS3_DENY_NONE -  Deny none.
  11744.  
  11745.  
  11746.  
  11747.  
  11748.  
  11749.  
  11750.                     SCL1 Version 3.1 - Reference Manual - Page 191
  11751.  
  11752.  
  11753.  
  11754.  
  11755.  
  11756.  
  11757.  
  11758.                                                                    OpenFile
  11759.  
  11760.                       Access mode:
  11761.  
  11762.                       DOS3_READ, DOS3_WRITE, DOS3_RW are similar to DOS
  11763.                       2.0.
  11764.  
  11765.               See DOS 3.0 Technical Reference for more information.
  11766.  
  11767.           Example:
  11768.  
  11769.           /* This is the source code of the File2Buf function */
  11770.  
  11771.           #include <scl1.h>
  11772.           #define FILE_TOO_BIG 255
  11773.  
  11774.           int File2Buf(char *FileName,char *Buffer,unsigned int * MaxSize)
  11775.           {
  11776.           int i,Handle;
  11777.           unsigned int Size;
  11778.  
  11779.           if(i=OpenFile(Filename,&Handle,DOS2_READ))
  11780.               return(i);
  11781.           if((Size=GetFileSize(Handle)> *MaxSize)
  11782.               {
  11783.               CloseFile(Handle);
  11784.               return(FILE_TOO_BIG);
  11785.               }
  11786.           if(i=ReadFile(Handle,Buffer,Size))
  11787.               {
  11788.               If(i>0)
  11789.                   CloseFile(Handle);
  11790.               return(i);
  11791.               }
  11792.           *MaxSize=Size;
  11793.           return(CloseFile(Handle));
  11794.           }
  11795.  
  11796.  
  11797.  
  11798.  
  11799.  
  11800.  
  11801.  
  11802.  
  11803.  
  11804.  
  11805.  
  11806.  
  11807.  
  11808.  
  11809.  
  11810.  
  11811.                     SCL1 Version 3.1 - Reference Manual - Page 192
  11812.  
  11813.  
  11814.  
  11815.  
  11816.  
  11817.  
  11818.  
  11819.                                                                  PercentBar
  11820.           -----------------------------------------------------------------
  11821.                                       PercentBar
  11822.           -----------------------------------------------------------------
  11823.  
  11824.           Purpose:    Displays a bar that graphically shows the completed
  11825.                       and uncompleted percentage of a given process.
  11826.  
  11827.           Prototype:  void PercentBar(int Mess,PBData *pbd,...);
  11828.  
  11829.           Returns:    This is a dialog derived function. See Appendix "E"
  11830.                       for a description of the general operation of these
  11831.                       functions.
  11832.  
  11833.           Parameters: The percent bar information is given in a structure
  11834.                       type PBData as follows:
  11835.  
  11836.           typedef struct{
  11837.               int Color;          Color to be used for the percent bar.
  11838.  
  11839.               int Row;            Row where to start the display of the
  11840.                                   bar.
  11841.  
  11842.               int Col;            Column where to start the display of the
  11843.                                   bar.
  11844.  
  11845.               int Size;           Size (number of columns) of the bar.
  11846.  
  11847.               unsigned int Total; Total percent value to be represented.
  11848.  
  11849.               int ForeChar;       Foreground character to be used for
  11850.                                   displaying the completed portion of the
  11851.                                   display.
  11852.  
  11853.               int BackChar;       Background character to be used for
  11854.                                   displaying the uncompleted portion of the
  11855.                                   display.
  11856.               }PBData;
  11857.  
  11858.           Messages:
  11859.  
  11860.           The following messages can be sent to PercentBar:
  11861.  
  11862.               PB_INIT - initialize the PBData structure to NULL and set the
  11863.               following default values:
  11864.  
  11865.                       Size - set to 80 column.
  11866.                       Total - set to 100 %.
  11867.                       ForeChar - set to solid block.
  11868.                       BackChar - set to checkered block.
  11869.  
  11870.  
  11871.  
  11872.                     SCL1 Version 3.1 - Reference Manual - Page 193
  11873.  
  11874.  
  11875.  
  11876.  
  11877.  
  11878.  
  11879.  
  11880.                                         PercentBar - PushCursor - PopCursor
  11881.  
  11882.               FB_DRAW - draw the PercentBar to the screen.
  11883.  
  11884.               FB_UPDATE - update the PercentBar display. Each time the
  11885.               function is called with this message and an additional
  11886.               parameter, holding the percent value, the PercentBar display
  11887.               will increment.
  11888.  
  11889.           Example:
  11890.  
  11891.           #include <scl1.h>
  11892.  
  11893.           main()
  11894.           {
  11895.           PBData pbd;
  11896.           int i;
  11897.  
  11898.           Cls(7,CLS_ALL);
  11899.           PercentBar(PB_INIT,&pbd);
  11900.           pbd.Row=10;
  11901.           pbd.Col=10;
  11902.           pbd.Total=100;
  11903.           pbd.Size=60;
  11904.           PercentBar(PB_DRAW,&pbd);
  11905.           for(i=1;i < 101;++i)
  11906.               {
  11907.               PercentBar(PB_UPDATE,&pbd,i);
  11908.               WaitTime(30);
  11909.               }
  11910.           }
  11911.  
  11912.           -----------------------------------------------------------------
  11913.                                 PushCursor, PopCursor
  11914.           -----------------------------------------------------------------
  11915.  
  11916.           Purpose:    Saves (PushCursor) or restores (PopCursor) the cursor
  11917.                       size, shape and position. The maximum number of
  11918.                       cursors that the function stack can hold is sixty-
  11919.                       four.
  11920.  
  11921.           Prototype:  int PushCursor(void);
  11922.                       int PopCursor(void);
  11923.  
  11924.           Returns:    Nothing.
  11925.  
  11926.           Parameters: None.
  11927.  
  11928.           Example:
  11929.  
  11930.           #include <scl1.h>
  11931.           #include <scl1keys.h>
  11932.  
  11933.                     SCL1 Version 3.1 - Reference Manual - Page 194
  11934.  
  11935.  
  11936.  
  11937.  
  11938.  
  11939.  
  11940.  
  11941.                                                      PushCursor - PopCursor
  11942.  
  11943.           /* Shows the use of cursor related functions */
  11944.  
  11945.           char Text[]="\n\nCursor size and position has been be saved using
  11946.                       PushCursor.\n\n"
  11947.                       "\t<*> Move the cursor around your screen using the
  11948.                       arrow keys\n"
  11949.                       "\t<*> Change cursor size using the TAB key\n"
  11950.                       "\t<*> Press ESC to restore original size and
  11951.           position\n";
  11952.  
  11953.           main()
  11954.           {
  11955.           unsigned int Key;
  11956.           int CurFlag=0;
  11957.  
  11958.           printf(Text);
  11959.  
  11960.           PushCursor();  /* save cursor size and position */
  11961.  
  11962.               /* let user modify size and position */
  11963.  
  11964.           do
  11965.               {
  11966.               switch((Key=GetKey()))
  11967.                   {
  11968.                   case UP:
  11969.                       SetCurPos(GetCurLine()-1,GetCurCol());
  11970.                       break;
  11971.                   case DOWN:
  11972.                       SetCurPos(GetCurLine()+1,GetCurCol());
  11973.                       break;
  11974.                   case LEFT:
  11975.                       SetCurPos(GetCurLine(),GetCurCol()-1);
  11976.                       break;
  11977.                   case RIGHT:
  11978.                       SetCurPos(GetCurLine(),GetCurCol()+1);
  11979.                       break;
  11980.                   case TAB:
  11981.                       CurFlag ^= 1;
  11982.                       if(CurFlag)
  11983.                          BigCursor();
  11984.                       else
  11985.                          CursorOn();
  11986.                       break;
  11987.                   }
  11988.               }while(Key != ESC);
  11989.  
  11990.               /* restore original size and position */
  11991.           PopCursor();
  11992.           }
  11993.  
  11994.                     SCL1 Version 3.1 - Reference Manual - Page 195
  11995.  
  11996.  
  11997.  
  11998.  
  11999.  
  12000.  
  12001.  
  12002.                                                                     PopMenu
  12003.           -----------------------------------------------------------------
  12004.                                        PopMenu
  12005.           -----------------------------------------------------------------
  12006.  
  12007.           Purpose:    Similar to Mouse Menu but draws the menu box and
  12008.                       saves the area behind the menu box. If the left or
  12009.                       right arrow is pressed the routine exits and returns
  12010.                       a value indicating which arrow key has been pressed.
  12011.  
  12012.           Prototype:  int PopMenu(int Color,int RColor, int HColor,
  12013.                          struct PopMenuData *k);
  12014.  
  12015.           Returns:    Return values are "-3" if the right cursor key is
  12016.                       pressed, "-2" if the left cursor key is pressed,"-1"
  12017.                       if ESCAPE is pressed or the option number if an
  12018.                       option key is pressed.
  12019.  
  12020.           Parameters: The menu information must be given as an array of
  12021.                       structures as follows:
  12022.  
  12023.           struct PopMenuData{
  12024.               int L1;                   Upper row position of the box used
  12025.                                         for the pull-down menu.
  12026.  
  12027.               int C1;                   Left column position of the box.
  12028.  
  12029.               int L2;                   Lower row position of the box.
  12030.  
  12031.               int C2;                   Right column position of the box.
  12032.  
  12033.               int NumberOption;         Number of options of the menu.
  12034.  
  12035.               char *WinBuffer;          Buffer to store the screen area
  12036.                                         used when popping out the menu.
  12037.  
  12038.               struct MenuOpt *Menust;   Pointer to the MenuOption structure
  12039.                                         corresponding to that menu.
  12040.               };
  12041.  
  12042.           The parameters passed to the function are:
  12043.  
  12044.               NColor - color for the menu background and foreground (int).
  12045.  
  12046.               RColor - color for the highlighted item menu bar (integer).
  12047.  
  12048.               HColor - color for the highlighted quick selection menu item
  12049.               letter (integer).
  12050.  
  12051.               PopMenuData - pointer to the PopMenuData structure
  12052.  
  12053.  
  12054.  
  12055.                     SCL1 Version 3.1 - Reference Manual - Page 196
  12056.  
  12057.  
  12058.  
  12059.  
  12060.  
  12061.  
  12062.  
  12063.                                                          PopMenu - ReadFile
  12064.  
  12065.           Example:
  12066.  
  12067.           #include <scl1.h>
  12068.           #include <scl1clor.h>
  12069.  
  12070.           struct MenuOpt Men1[]={
  12071.               2,5,"New    ",'N',
  12072.               3,5,"Open   ",'O',
  12073.               4,5,"Close  ",'C',
  12074.               5,5,"Save   ",'S',
  12075.               6,5,"Exit   ",'E',
  12076.               };
  12077.  
  12078.           struct PopMenuData pmd1[]={
  12079.               1,3,7,13,
  12080.               5,
  12081.               WinBuf1,
  12082.               Men1,
  12083.               };
  12084.  
  12085.           main()
  12086.           {
  12087.           int Selection;
  12088.           Selection=PopMenu(WHITE_BLACK,BLACK_WHITE,BLACK_WHITE+HIGHLIGHT,p
  12089.           md1);
  12090.           }
  12091.  
  12092.           -----------------------------------------------------------------
  12093.                                        ReadFile
  12094.           -----------------------------------------------------------------
  12095.  
  12096.           Purpose:    Reads number of bytes from a file
  12097.  
  12098.           Prototype:  int ReadFile(int Handle,char *Buffer,
  12099.                          unsigned int Bytes);
  12100.  
  12101.           Returns:    The DOS error code or "0" if no error occurs. (See
  12102.                       Appendix "A", FILE FUNCTIONS, for more information).
  12103.  
  12104.           Parameters:
  12105.  
  12106.               Handle - handle number given by DOS when you open or create a
  12107.               file (integer).
  12108.  
  12109.               Buffer - pointer to the buffer that will hold the data.
  12110.  
  12111.               Bytes - pointer to a variable that holds the number of bytes
  12112.               to read (unsigned integer).
  12113.  
  12114.           Example:    See OpenFile
  12115.  
  12116.                     SCL1 Version 3.1 - Reference Manual - Page 197
  12117.  
  12118.  
  12119.  
  12120.  
  12121.  
  12122.  
  12123.  
  12124.                                                    ReadPalette - RecordFile
  12125.           -----------------------------------------------------------------
  12126.                                      ReadPalette
  12127.           -----------------------------------------------------------------
  12128.  
  12129.           Purpose:    Fills an array with the active  palette information.
  12130.  
  12131.           Prototype:  int ReadPalette(char *Colors);
  12132.  
  12133.           Returns:    "-1" if it cannot read the palette.
  12134.  
  12135.           Parameter:  Colors - pointer to an array that contains the
  12136.                       palette information. See Appendix "J".
  12137.  
  12138.           Example:
  12139.  
  12140.           #include <scl1.h>
  12141.  
  12142.           main()
  12143.           {
  12144.           char Colors[17];
  12145.           if (ReadPalette (Colors)==-1);
  12146.               printf("Cannot read palette/n");
  12147.           }
  12148.  
  12149.           -----------------------------------------------------------------
  12150.                                       RecordFile
  12151.           -----------------------------------------------------------------
  12152.  
  12153.           Purpose:    Provides a method for managing record files.
  12154.  
  12155.           Prototype:  int RecordFile(int Mess,SFData *sfd);
  12156.  
  12157.           Returns:    This is a dialog derived function. See Appendix "E"
  12158.                       for a description of the general operation of these
  12159.                       functions. Returns the messages described in the
  12160.                       Messages section.
  12161.  
  12162.           Parameters: The file information is given in a structure type
  12163.                       RFData as follows:
  12164.  
  12165.           typedef struct{
  12166.               char *FName;           Pointer to a valid filename.
  12167.  
  12168.               char *Buffer;          Pointer to the buffer that holds the
  12169.                                      record.
  12170.  
  12171.               unsigned int DataSize; Size of data block.
  12172.  
  12173.               long FPos;             Variable (internal) that holds the
  12174.                                      current record's file pointer (long).
  12175.  
  12176.  
  12177.                     SCL1 Version 3.1 - Reference Manual - Page 198
  12178.  
  12179.  
  12180.  
  12181.  
  12182.  
  12183.  
  12184.  
  12185.                                                                  RecordFile
  12186.  
  12187.               long FSize;            Variable (internal) that holds the
  12188.                                      file size.
  12189.  
  12190.               long Entries;          Variable (internal) that holds the
  12191.                                      number of records.
  12192.  
  12193.               int FHandle;           Variable (internal) that holds the
  12194.                                      file handle assigned to the file.
  12195.  
  12196.               int Error;             Variable (internal) that contain any
  12197.                                      errors that have occurred.
  12198.               }RFData;
  12199.  
  12200.           Messages:
  12201.  
  12202.           The following messages can be sent to RecordFile:
  12203.  
  12204.               RF_OPEN - Open a file for record reading or writing.
  12205.  
  12206.               RF_CREATE - Create a file for record reading or writing.
  12207.  
  12208.               RF_FIRST - Move file pointer and read the first record.
  12209.  
  12210.               RF_LAST - Move file pointer and read the last record.
  12211.  
  12212.               RF_NEXT - Move file pointer and read the next record.
  12213.  
  12214.               RF_PREVIOUS - Move file pointer and read previous record.
  12215.  
  12216.               RF_CLOSE - Close file.
  12217.  
  12218.               RF_ADD - Add a record to file.
  12219.  
  12220.               RF_OPENCREATE - Opens a file for record reading or writing or
  12221.               creates the file if it does not exists.
  12222.  
  12223.               RF_WRITE - Write buffer to file.
  12224.  
  12225.               RF_SETPOS - Set the file pointer to the desired record
  12226.               number.
  12227.  
  12228.               RF_READ - Read a record from file.
  12229.  
  12230.           The following messages can be returned by RecordFile:
  12231.  
  12232.               RF_OK - The requested operation was performed without errors.
  12233.  
  12234.               RF_FILENOTFOUND - The specified file was not found.
  12235.  
  12236.               RF_EOF - You have reached the end of the file.
  12237.  
  12238.                     SCL1 Version 3.1 - Reference Manual - Page 199
  12239.  
  12240.  
  12241.  
  12242.  
  12243.  
  12244.  
  12245.  
  12246.                                                                  RecordFile
  12247.  
  12248.               RF_BOF - You have reached the beginning of the file.
  12249.  
  12250.               RF_READERR - A read error was encountered.
  12251.  
  12252.               RF_WRITEERR - A write error was encountered.
  12253.  
  12254.               RF_ILLEGALOP - An illegal operation has been requested.
  12255.  
  12256.           Example:
  12257.  
  12258.           #include <scl1.h>
  12259.  
  12260.           /*  This example shows the use of the RecordFile function to
  12261.               create and use a data file organized in records */
  12262.  
  12263.           char buffer[4];   /* data buffer */
  12264.  
  12265.               /* this data will be stored in a RecordFile file */
  12266.  
  12267.           char *test[]={"1","2","3","4","5","6","7"};
  12268.  
  12269.               /* RecordFile struct */
  12270.  
  12271.           RFData rfd={"TEST.RF",buffer,2,};
  12272.  
  12273.           main()
  12274.           {
  12275.           int Mess,i;
  12276.  
  12277.           if(Mess=RecordFile(RF_CREATE,&rfd))     /* create file */
  12278.               {
  12279.               printf("%i\n",Mess);                /* error */
  12280.               exit(-1);
  12281.               }
  12282.  
  12283.           for(i=0;i < 7;++i)                      /* add records */
  12284.               {
  12285.               rfd.Buffer=test[i];
  12286.               if(Mess=RecordFile(RF_ADD,&rfd))
  12287.                   {
  12288.                   printf("%i\n",Mess);            /* error */
  12289.                   RecordFile(RF_CLOSE,&rfd);
  12290.                   exit(-1);
  12291.                   }
  12292.  
  12293.               /* read and print file position and size */
  12294.  
  12295.               printf("Adding record %i, file position: %li, file size:
  12296.                    %li\n",i,rfd.FPos,rfd.FSize);
  12297.               }
  12298.  
  12299.                     SCL1 Version 3.1 - Reference Manual - Page 200
  12300.  
  12301.  
  12302.  
  12303.  
  12304.  
  12305.  
  12306.  
  12307.                                                                  RecordFile
  12308.  
  12309.           printf("Press any key...\n");
  12310.  
  12311.           GetKey();
  12312.  
  12313.               /*  make rfd.Buffer point to our buffer so that all data is
  12314.                   be copied to our buffer. We will read all records */
  12315.  
  12316.           printf("Records in the order the were saved\n");
  12317.  
  12318.           rfd.Buffer=buffer;
  12319.           if(RecordFile(RF_FIRST,&rfd)==RF_OK)    /* get first record*/
  12320.               {
  12321.               do                                  /* print it */
  12322.                   {
  12323.                   printf("%s\n",buffer);
  12324.                   }while(RecordFile(RF_NEXT,&rfd) != RF_EOF);/* get next */
  12325.               }
  12326.  
  12327.           printf("Press any key...\n");
  12328.           GetKey();
  12329.           printf("Records in reverse order\n");
  12330.  
  12331.               /* get last record */
  12332.  
  12333.           if(RecordFile(RF_LAST,&rfd)==RF_OK)
  12334.               {
  12335.               do
  12336.                   {
  12337.                   printf("%s\n",buffer);
  12338.                   }while(RecordFile(RF_PREVIOUS,&rfd) != RF_BOF);
  12339.                                                   /* previous*/
  12340.               }
  12341.  
  12342.           printf("Press any key...\n");
  12343.           GetKey();
  12344.           printf("Record=3 modified to A\n");
  12345.  
  12346.               /* look for record with data 3 and modify it */
  12347.  
  12348.           if(RecordFile(RF_FIRST,&rfd)==RF_OK)         /* get first */
  12349.               {
  12350.               do
  12351.                   {
  12352.                   if(strcmp(buffer,"3")==0)            /* equal? */
  12353.                       {
  12354.                       strcpy(buffer,"A");              /* modify */
  12355.                       RecordFile(RF_WRITE,&rfd);       /* write data */
  12356.                       }
  12357.                   }while(RecordFile(RF_NEXT,&rfd) != RF_EOF);/* get next */
  12358.               }
  12359.  
  12360.                     SCL1 Version 3.1 - Reference Manual - Page 201
  12361.  
  12362.  
  12363.  
  12364.  
  12365.  
  12366.  
  12367.  
  12368.                                    RecordFile - RemoveDir - RemoveExtension
  12369.  
  12370.               /* show all records */
  12371.           if(RecordFile(RF_FIRST,&rfd)==RF_OK)
  12372.               {
  12373.               do
  12374.                   {
  12375.                   printf("%s\n",buffer);
  12376.                   }while(RecordFile(RF_NEXT,&rfd) != RF_EOF);
  12377.               }
  12378.  
  12379.           RecordFile(RF_CLOSE,&rfd);  /* close file */
  12380.           GetKey();
  12381.           }
  12382.  
  12383.           -----------------------------------------------------------------
  12384.                                       RemoveDir
  12385.           -----------------------------------------------------------------
  12386.  
  12387.           Purpose:    Removes a directory
  12388.  
  12389.           Prototype:  int RemoveDir(char *Path);
  12390.  
  12391.           Returns:    The DOS error code or "0" if no error occurs. (See
  12392.                       Appendix "A", FILE FUNCTIONS, for more information).
  12393.  
  12394.           Parameter:  Path - char pointer to directory string.
  12395.  
  12396.           Example:    See MakeDir
  12397.  
  12398.           -----------------------------------------------------------------
  12399.                                    RemoveExtension
  12400.           -----------------------------------------------------------------
  12401.  
  12402.           Purpose:    Removes the extension of a filename.
  12403.  
  12404.           Prototype:  char *RemoveExtension(char *Filename);
  12405.  
  12406.           Returns:    A pointer to the filename buffer.
  12407.  
  12408.           Parameter:  Filename - char pointer to filename.
  12409.  
  12410.           Example:
  12411.  
  12412.           #include <scl1.h>
  12413.           char Filename[13]="FILE.C";
  12414.  
  12415.           main()
  12416.           {
  12417.           printf("%s\n",Filename);
  12418.           printf("%s\n",RemoveExtension(Filename));
  12419.           }
  12420.  
  12421.                     SCL1 Version 3.1 - Reference Manual - Page 202
  12422.  
  12423.  
  12424.  
  12425.  
  12426.  
  12427.  
  12428.  
  12429.                                                                  RenameFile
  12430.           -----------------------------------------------------------------
  12431.                                       RenameFile
  12432.           -----------------------------------------------------------------
  12433.  
  12434.           Purpose:    Renames or moves a file.
  12435.  
  12436.           Prototype:  int RenameFile(char *OldName,char *NewName);
  12437.  
  12438.           Returns:    The DOS error code or "0" if no error occurs.  (See
  12439.                       Appendix "A", FILE FUNCTIONS, for more information).
  12440.  
  12441.           Parameters:
  12442.  
  12443.               OldName - pointer to the old filename (char).
  12444.  
  12445.               NewName - pointer to the new filename (char).
  12446.  
  12447.           Example:
  12448.  
  12449.           #include <scl1.h>
  12450.  
  12451.           main()
  12452.           {
  12453.           int handle;
  12454.  
  12455.           printf("\nCreating file SCL1.TST...\n");
  12456.           if(CreateFile("SCL1.TST",&handle,F_ARCHIVE))
  12457.               printf("\nUnable to create file.\n");
  12458.           else
  12459.               CloseFile(handle);
  12460.  
  12461.           printf("\nRenaming file SCL1.TST ==> SCL1.BAK...\n");
  12462.  
  12463.           if(RenameFile("SCL1.TST","SCL1.BAK"))
  12464.               printf("\nUnable to rename file.\n");
  12465.           else
  12466.               {
  12467.               printf("\nDeleting SCL1.BAK...\n");
  12468.               DeleteFile("SCL1.BAK");
  12469.               }
  12470.           }
  12471.  
  12472.  
  12473.  
  12474.  
  12475.  
  12476.  
  12477.  
  12478.  
  12479.  
  12480.  
  12481.  
  12482.                     SCL1 Version 3.1 - Reference Manual - Page 203
  12483.  
  12484.  
  12485.  
  12486.  
  12487.  
  12488.  
  12489.  
  12490.                                                  ResetMouse - ResetMouseCur
  12491.           -----------------------------------------------------------------
  12492.                                       ResetMouse
  12493.           -----------------------------------------------------------------
  12494.  
  12495.           Purpose:    Resets mouse to default condition (cursor hidden at
  12496.                       the screen center and Interrupt service routine
  12497.                       disabled).
  12498.  
  12499.           Prototype:  void ResetMouse(void);
  12500.  
  12501.           Returns:    Nothing.
  12502.  
  12503.           Parameters: None
  12504.  
  12505.           Example:    See CheckMouse
  12506.  
  12507.           -----------------------------------------------------------------
  12508.                                     ResetMouseCur
  12509.           -----------------------------------------------------------------
  12510.  
  12511.           Purpose:    Resets mouse cursor to a block character.
  12512.  
  12513.           Prototype:  void ResetMouseCur(void);
  12514.  
  12515.           Returns:    Nothing
  12516.  
  12517.           Parameters: None
  12518.  
  12519.           Example:
  12520.  
  12521.           include <scl1.h>
  12522.           #include <scl1clor.h>
  12523.  
  12524.           main()
  12525.           {
  12526.           GSSBox(WHITE_BLACK,0,0,0,24,79,1,0,0);
  12527.           InitMouse(IM_SHOW);
  12528.           if(MSE_MouseFl)
  12529.               {
  12530.               SetMouseCur('*');
  12531.               WriteScreenLen(WHITE_BLACK,23,2,40,"Mouse cursor set to '*'
  12532.                             character");
  12533.               WaitTime(300);
  12534.               ResetMouseCur();
  12535.               WriteScreenLen(WHITE_BLACK,23,2,40,"Mouse cursor reset to
  12536.                             normal");
  12537.               WaitTime(300);
  12538.               }
  12539.           else
  12540.               WriteScreenLen(WHITE_BLACK,23,2,40,"No mouse installed.");
  12541.           }
  12542.  
  12543.                     SCL1 Version 3.1 - Reference Manual - Page 204
  12544.  
  12545.  
  12546.  
  12547.  
  12548.  
  12549.  
  12550.  
  12551.                                                                  ScreenDump
  12552.           -----------------------------------------------------------------
  12553.                                       ScreenDump
  12554.           -----------------------------------------------------------------
  12555.  
  12556.           Purpose:    Displays a screendump array in the screen. A
  12557.                       screendump array consists of characters followed by
  12558.                       its color attribute byte, terminated with a "0", \n
  12559.                       can be used to indicate end of lines.
  12560.  
  12561.           Prototype:  void ScreenDump(int Row, int Column, char *Array);
  12562.  
  12563.           Returns:    Nothing
  12564.            
  12565.           Parameters:
  12566.  
  12567.               Row - row position for the array display (integer).
  12568.  
  12569.               Column - column position for array display (integer).
  12570.  
  12571.               Array - pointer to the array buffer (char).
  12572.  
  12573.           Example:
  12574.  
  12575.           #include <scl1.h>
  12576.  
  12577.           /*  Each character is followed by its color attribute, a \n can
  12578.               be used to indicate end of lines and a "0" must be used to
  12579.               indicate the end of the array */
  12580.  
  12581.           char Array[]={'A',7,'B',0x70,\n,'C',0x70,'D',7,0};
  12582.  
  12583.           main()
  12584.           {
  12585.  
  12586.               ScreenDump(10,10,Array); /* Write at line 10, column 10 */
  12587.               GetKey();
  12588.  
  12589.               ChangeDumpColor(0x70,7,Array);
  12590.               ScreenDump(10,10,Array); /* Write at line 10, column 10 */
  12591.               /* Change all character attributes 0x17 to 7 */
  12592.           }
  12593.  
  12594.  
  12595.           See also ChangeDumpColor.
  12596.  
  12597.  
  12598.  
  12599.  
  12600.  
  12601.  
  12602.  
  12603.  
  12604.                     SCL1 Version 3.1 - Reference Manual - Page 205
  12605.  
  12606.  
  12607.  
  12608.  
  12609.  
  12610.  
  12611.  
  12612.                                                       ScrollDown - ScrollUp
  12613.           -----------------------------------------------------------------
  12614.                                  ScrollDown, ScrollUp
  12615.           -----------------------------------------------------------------
  12616.  
  12617.           Purpose:    Scrolls down (ScrollDown) or up (ScrollUp) a screen
  12618.                       area.
  12619.  
  12620.           Prototype:  void ScrollDown(int Color,int UpperRow,int LeftCol,
  12621.                          int LowerRow,int RightCol,int Scroll);
  12622.  
  12623.                       void ScrollUp(int Color,int UpperRow,int LeftCol,
  12624.                          int LowerRow,int RightCol,int Scroll);
  12625.  
  12626.           Returns:    Nothing
  12627.  
  12628.           Parameters:
  12629.  
  12630.               Color - color of the area to be scrolled (integer).
  12631.  
  12632.               UpperRow - upper row of the area to be scrolled (int).
  12633.  
  12634.               LeftCol - left column of the area to be scrolled (int).
  12635.  
  12636.               LowerRow - lower row of the area to be scrolled (int).
  12637.  
  12638.               RightCol - right column of the area to be scrolled (int).
  12639.  
  12640.               Scroll - number of lines to scroll, if this variable is set
  12641.               to "0" the whole window is cleared (integer).
  12642.  
  12643.           Example:
  12644.  
  12645.           #include <scl1.h>
  12646.           #include <scl1clor.h>
  12647.  
  12648.           char Mess1[]="The screen has been scrolled DOWN 1 line";
  12649.           char Mess2[]="The screen has been scrolled UP 1 line";
  12650.  
  12651.           main()
  12652.           {
  12653.           Box(WHITE_BLACK,0,0,0,23,79);
  12654.           WaitTime(200);
  12655.           ScrollDown(WHITE_BLACK,0,0,24,79,1);
  12656.           WriteScreen(BLACK_WHITE,0,Center(Mess1),Mess1);
  12657.           WaitTime(200);
  12658.  
  12659.           ScrollUp(WHITE_BLACK,0,0,24,79,1);
  12660.           WriteScreen(BLACK_WHITE,24,Center(Mess2),Mess2);
  12661.           }
  12662.  
  12663.  
  12664.  
  12665.                     SCL1 Version 3.1 - Reference Manual - Page 206
  12666.  
  12667.  
  12668.  
  12669.  
  12670.  
  12671.  
  12672.  
  12673.                                                                  ScrollList
  12674.           -----------------------------------------------------------------
  12675.                                       ScrollList
  12676.           -----------------------------------------------------------------
  12677.  
  12678.           Purpose:    Displays a list of items enclosed in a box. The
  12679.                       function permits to scroll through the items using
  12680.                       the arrow keys or the mouse.  To select an item press
  12681.                       the ENTER key or click the mouse on it.
  12682.  
  12683.           Prototype:  int ScrollList(int NColor,int RColor,int Row,
  12684.                          int Col,int Lines,char **p);
  12685.  
  12686.           Returns:    The selected item's number or "-1" if the ESC key is
  12687.                       pressed.
  12688.  
  12689.           Parameters:
  12690.  
  12691.           The scroll list information must be given in a null terminated
  12692.           char pointer array.
  12693.  
  12694.           The parameters passed to the function are:
  12695.  
  12696.               NColor - color for the normal display of items (integer).
  12697.  
  12698.               RColor - color for the highlighted item (integer).
  12699.  
  12700.               Row - row position for the display of the first item of the
  12701.               scroll list (integer).
  12702.  
  12703.               Col - column position for the display of the first item of
  12704.               the scroll list (integer).
  12705.  
  12706.               Lines - number of lines to display in the box (integer).
  12707.  
  12708.               p - pointer to a null terminated array of char pointers.
  12709.  
  12710.           Example:
  12711.  
  12712.           #include <scl1.h>
  12713.           #include <scl1clor.h>
  12714.           char *SList[]={
  12715.               "Append File",
  12716.               "Browse File",
  12717.               "Copy file",
  12718.               "Delete File",
  12719.               "Merge Files",
  12720.               "Move File",
  12721.               "Sort File",
  12722.               "Tag File",
  12723.               0};
  12724.  
  12725.  
  12726.                     SCL1 Version 3.1 - Reference Manual - Page 207
  12727.  
  12728.  
  12729.  
  12730.  
  12731.  
  12732.  
  12733.  
  12734.                                                   ScrollList - ScrollWindow
  12735.  
  12736.           main()
  12737.           {
  12738.           int selection;
  12739.  
  12740.           Cls(7,CLS_ALL);
  12741.           selection=ScrollList(WHITE_BLACK,BLACK_WHITE,5,40,5,SList);
  12742.           SetCurPos(20,0);
  12743.           if(selection > 0)
  12744.               printf("\n%s was selected\n",SList[selection-1]);
  12745.           else
  12746.               printf("\Operation was canceled\n");
  12747.           }
  12748.  
  12749.           -----------------------------------------------------------------
  12750.                                      ScrollWindow
  12751.           -----------------------------------------------------------------
  12752.  
  12753.           Purpose:    Displays a window with a list of items. If the list
  12754.                       is larger than the window, or if an item's length is
  12755.                       larger than the display width, the display area can
  12756.                       scroll both horizontally and vertically. The window
  12757.                       can have scroll bars at the right and the bottom to
  12758.                       show the relative position of the text within the
  12759.                       window. It permits you to scroll through the items
  12760.                       using the cursor keys or the mouse. You can tag or
  12761.                       untag items by pressing the SPACEBAR or clicking the
  12762.                       mouse after pointing to an item. To select an item
  12763.                       press the ENTER key or double click the mouse after
  12764.                       pointing to the item.
  12765.  
  12766.           Prototype:  int ScrollWindow(int Message,SWData *p,...)
  12767.  
  12768.           Returns:    This is a dialog type function. See Appendix "E" for
  12769.                       a description of the general operation of these
  12770.                       functions.  Returns a message described in the
  12771.                       Messages section.
  12772.  
  12773.           Parameters:
  12774.  
  12775.           Dialog type functions receive messages and structures as
  12776.           parameters. The scroll window information must be given in a
  12777.           structure type SWData as follows:
  12778.  
  12779.           typedef struct{
  12780.               int NColor;               Color for normal display.
  12781.  
  12782.               int RColor;               Color for reversed display.
  12783.  
  12784.               int UpperRow;             Upper row position of the window.
  12785.  
  12786.  
  12787.                     SCL1 Version 3.1 - Reference Manual - Page 208
  12788.  
  12789.  
  12790.  
  12791.  
  12792.  
  12793.  
  12794.  
  12795.                                                                ScrollWindow
  12796.  
  12797.               int LeftCol;              Left column position of the window.
  12798.  
  12799.               int LowerRow;             Lower row position of the window.
  12800.  
  12801.               int RightCol;             Right column of the window.
  12802.  
  12803.               int FrameType;            Frame type as defined in Box.
  12804.  
  12805.               int ScrollBar;            Flag to tell the function to draw
  12806.                                         scroll bars.
  12807.  
  12808.               int BarColor;             Color for the scroll bars.
  12809.  
  12810.               char **Array;             Pointer to a null terminated array
  12811.                                         of pointers to be displayed.
  12812.  
  12813.               char *TagArray;           Array that holds which item has
  12814.                                         been tagged. If a null pointer is
  12815.                                         specified the function will not
  12816.                                         permit tagging. Array element
  12817.                                         values of "0" and "1" indicate the
  12818.                                         status for untagged and tagged.
  12819.  
  12820.               int TagColor;             Color to be used for displaying
  12821.                                         tagged items.
  12822.  
  12823.               char *Title;              Char pointer to text to be
  12824.                                         displayed as a title.
  12825.  
  12826.               int TitleColor;           Color for the title's display.
  12827.  
  12828.               unsigned int *ExitKeys;   Array of keys to exit the function.
  12829.  
  12830.               unsigned int Lines;       Variable (internal) that holds the
  12831.                                         quantity of items in the array.
  12832.  
  12833.               unsigned int Length;      Variable (internal) that holds the
  12834.                                         length of the longest element in
  12835.                                         the ScrollWindow array.
  12836.  
  12837.               unsigned int TopLine;     Variable (internal) that holds the
  12838.                                         element number that is being
  12839.                                         displayed in the first line of the
  12840.                                         window.
  12841.  
  12842.               unsigned int Position;    Variable (internal) that holds the
  12843.                                         active position of the display. 
  12844.                                         Note this element should not be
  12845.                                         modified by the calling program.
  12846.  
  12847.  
  12848.                     SCL1 Version 3.1 - Reference Manual - Page 209
  12849.  
  12850.  
  12851.  
  12852.  
  12853.  
  12854.  
  12855.  
  12856.                                                                ScrollWindow
  12857.  
  12858.               unsigned int FirstCol;    Variable (internal) that holds the
  12859.                                         horizontal offset of the window. If
  12860.                                         there is no horizontal scroll, its
  12861.                                         value is "0". When there is scroll
  12862.                                         the value will be the number of
  12863.                                         columns to the left of the first
  12864.                                         column displayed.
  12865.  
  12866.               int OldVBlock;            Variable (internal) that holds the
  12867.                                         position of the vertical relative
  12868.                                         position scroll bar block.
  12869.  
  12870.               int OldHBlock;            Variable (internal) that holds the
  12871.                                         position of the horizontal relative
  12872.                                         position scroll bar block.
  12873.  
  12874.               int WindowLines;          Variable (internal) that holds the
  12875.                                         number of lines in the List Window.
  12876.  
  12877.               int WindowCols;           Variable (internal) that holds the
  12878.                                         number of columns in the Window.
  12879.  
  12880.               int VScroll;              Variable (internal) that keeps
  12881.                                         track if a vertical scroll is
  12882.                                         required.
  12883.  
  12884.               int HScroll;              Variable (internal) that keeps
  12885.                                         track if horizontal scroll is
  12886.                                         required.
  12887.  
  12888.               unsigned int EventInfo;   Information about the keys that
  12889.                                         have been pressed.
  12890.               }SWData;
  12891.  
  12892.           Messages:
  12893.  
  12894.           The messages that can be sent to the ScrollWindow function are:
  12895.  
  12896.               SW_INIT - Initialize the SWData structure to its default
  12897.               values.  The default values are:
  12898.  
  12899.                   NColor - set to white characters in a black background or
  12900.                   the normal color set by SetDialogColors.
  12901.  
  12902.                   RColor - set to black characters in a white background or
  12903.                   the reversed color set by SetDialogColors.
  12904.  
  12905.                   LowerRow and RightCol - one less than the screen length.
  12906.  
  12907.                   FrameType - set to frame type "1" (single line).
  12908.  
  12909.                     SCL1 Version 3.1 - Reference Manual - Page 210
  12910.  
  12911.  
  12912.  
  12913.  
  12914.  
  12915.  
  12916.  
  12917.                                                                ScrollWindow
  12918.  
  12919.                   ScrollBar - set to draw scroll bars.
  12920.  
  12921.                   BarColor - set to black characters in a white background
  12922.                   or the reversed color set by SetDialogColors.
  12923.  
  12924.                   TagColor - set to black characters in a white background
  12925.                   or the reversed color set by SetDialogColors.
  12926.  
  12927.                   TitleColor - set to white characters in a black
  12928.                   background or the normal color set by SetDialogColors.
  12929.  
  12930.                   OldVBlock - set to "-1".
  12931.  
  12932.                   OldHBlock - set to "-1".
  12933.  
  12934.               SW_DRAW - display the Scroll Window with the current
  12935.               parameters.
  12936.  
  12937.               SW_WRITE - write the items to the screen.
  12938.  
  12939.               SW_ACTIVE - browse through the displayed items and permit the
  12940.               selection or tagging of them using the keyboard as follows:
  12941.  
  12942.                          Key                  action
  12943.  
  12944.                       Up Arrow       cursor one item up.
  12945.                       Down Arrow     cursor one item down.
  12946.                       END            cursor to end of file list.
  12947.                       HOME           cursor to beginning of list.
  12948.                       Page Up        cursor one screen up.
  12949.                       Page Down      cursor one screen down.
  12950.  
  12951.               SW_DRAW_BORDER - draw the Scroll Window's border.
  12952.  
  12953.               SW_POSITION_BEGIN - move cursor to the first item.
  12954.  
  12955.               SW_POSITION_END - move cursor to the last item.
  12956.  
  12957.               SW_POSITION_UP - move cursor to the previous item.
  12958.  
  12959.               SW_POSITION_DOWN - move cursor to the next item.
  12960.  
  12961.               SW_SET_POSITION - move cursor to the item number passed as a
  12962.               parameter.
  12963.  
  12964.               SW_CLS - clear the list window.
  12965.  
  12966.               SW_CHECK_MOUSE - check if the mouse has been clicked after
  12967.               pointing to the area defined by the function.
  12968.  
  12969.  
  12970.                     SCL1 Version 3.1 - Reference Manual - Page 211
  12971.  
  12972.  
  12973.  
  12974.  
  12975.  
  12976.  
  12977.  
  12978.                                                                ScrollWindow
  12979.  
  12980.               SW_UWRITE - similar to SW_WRITE but recalculates all the
  12981.               internal variables and redraws the frame if needed.
  12982.  
  12983.               SW_RESET - when this message is sent the position variables
  12984.               are reset to the default value. If the exit keys have not
  12985.               been defined they are set to the default exit keys.
  12986.  
  12987.               SW_MBAR_CHARS - this message is used to change the characters
  12988.               used for the scroll bars display. Default characters are
  12989.               defined in header file SCL1.H as SW_MBAR_DEF (character for
  12990.               the background) and SW_THUMB_DEF (character to display the
  12991.               relative position). Pass the desired characters as additional
  12992.               parameters (for example, ScrollWindow(SW_MBAR_CHARS, &swd,
  12993.               SW_MBAR_DEF, 254);).
  12994.  
  12995.           The messages returned by ScrollWindow are:
  12996.  
  12997.               SW_NULL_ARRAY - no item array has been defined.
  12998.  
  12999.               SW_OK - the requested action has been performed.
  13000.  
  13001.               SW_EXIT_KEY - a defined exit key has been pressed.
  13002.  
  13003.               SW_MOUSE_EVENT - the mouse has been clicked but it has not
  13004.               been pointed to the area defined by the function.
  13005.  
  13006.               SW_BUFFER_END - you have requested to move the cursor passed
  13007.               the last item.
  13008.  
  13009.               SW_BUFFER_BEGIN - you have requested to move the cursor up
  13010.               and you have the first active item.
  13011.  
  13012.               SW_ILLEGAL_KEY - an undefined key has been pressed.
  13013.  
  13014.               SW_ILLEGAL_POSITION - you have requested to move the cursor
  13015.               to an invalid position.
  13016.  
  13017.               SW_NEW_POSITION - the cursor position has been updated.
  13018.  
  13019.               SW_MOUSE_SELECT - one of the elements have been selected by
  13020.               double clicking the mouse.
  13021.  
  13022.               SW_MY_MOUSE - response to a SW_CHECK_MOUSE message if the
  13023.               mouse has been clicked after pointing to the area defined by
  13024.               the function.
  13025.  
  13026.               SW_NEW_MOUSEPOS - you have moved the cursor by clicking the
  13027.               mouse after pointing to an item.
  13028.  
  13029.  
  13030.  
  13031.                     SCL1 Version 3.1 - Reference Manual - Page 212
  13032.  
  13033.  
  13034.  
  13035.  
  13036.  
  13037.  
  13038.  
  13039.                                                                ScrollWindow
  13040.  
  13041.               SW_BLOCK_MARK - this message is returned when you have marked
  13042.               a series of items by dragging you mouse after clicking at an
  13043.               item.
  13044.  
  13045.           Example:
  13046.  
  13047.           #include <scl1.h>
  13048.           #include <scl1clor.h>
  13049.           #include <scl1keys.h>
  13050.  
  13051.           char *Info[]={
  13052.           " BigCursor         - Changes the cursor size to a block.",
  13053.           " Center            - Centers a string horizontally.",
  13054.           " Cls               - Clears a screen area.",
  13055.           " CursorOff         - Turns the cursor off.",
  13056.           " CursorOn          - Turns the cursor on (cursor visible).",
  13057.           " DrawItemList      - Draws an item list to the screen.",
  13058.           " GetCurLine        - Returns the current cursor row position.",
  13059.           " GetCurSize        - Returns the current cursor size.",
  13060.           " ScrollUp          - Scrolls up a screen area.",
  13061.           " SetCurPos         - Sets the cursor position.",
  13062.           " SetCurSize        - Sets the cursor size.",
  13063.           " SetVideoMode      - Sets the video mode.",
  13064.           " SetVideoPage      - Sets the video page.",
  13065.           " SetVideo25        - Sets the display mode to 25 lines.",
  13066.           " Shadow            - Draws a shadow effect to a screen area.",
  13067.           " Video             - Detects if the video adapter in use is",
  13068.           "                     either Monochrome, CGA or EGA.",
  13069.           " WriteCharBlock    - Writes a block of characters.",
  13070.           0};
  13071.  
  13072.           unsigned int ExitK[]={ESC,ENTER,0};
  13073.  
  13074.           main()
  13075.           {
  13076.           int i;
  13077.           SWData sw;  /* Scroll Window structure */
  13078.  
  13079.           CursorOff();                  /* Turn off cursor */
  13080.           InitMouse(IM_SHOW);
  13081.           Cls(WHITE_BLACK,CLS_ALL);
  13082.           ScrollWindow(SW_INIT,&sw);    /* Initialize Scroll Window */
  13083.           sw.UpperRow=2;                /* Change default window size */
  13084.           sw.LeftCol=4;
  13085.           sw.LowerRow=15;
  13086.           sw.RightCol=75;
  13087.           sw.ExitKeys=ExitK;
  13088.           sw.Array=Info;
  13089.           sw.Title="[ Information ]";
  13090.           ScrollWindow(SW_DRAW,&sw);    /* Now, draw the Scroll Window */
  13091.  
  13092.                     SCL1 Version 3.1 - Reference Manual - Page 213
  13093.  
  13094.  
  13095.  
  13096.  
  13097.  
  13098.  
  13099.  
  13100.                                                       ScrollWindow - Select
  13101.  
  13102.           do                            /* Browse window until an exit key
  13103.                                            is pressed*/
  13104.               {
  13105.               i=ScrollWindow(SW_ACTIVE,&sw);
  13106.               if (i==SW_ILLEGAL_KEY)
  13107.                   SW_MoveTo(&sw);
  13108.               }while(i!=SW_EXIT_KEY && i!=SW_MOUSE_EVENT);
  13109.           CursorOn();
  13110.           Cls(7,CLS_ALL);
  13111.           }
  13112.  
  13113.           -----------------------------------------------------------------
  13114.                                         Select
  13115.           -----------------------------------------------------------------
  13116.  
  13117.           Purpose:    Permits the display of various options and let the
  13118.                       user select one of them.  The active option will be
  13119.                       displayed with a check mark between parenthesis (√).
  13120.                       You can use the keyboard to move among options. A
  13121.                       selection can be made by clicking the left mouse
  13122.                       button after pointing to the desired option or by
  13123.                       pressing a key defined as an exit key.  It can either
  13124.                       be used alone or as one of the field types for the
  13125.                       Fields2 function.
  13126.  
  13127.           Prototype: int Select(int Message,SData1 *sd1,SData2 *sd2)
  13128.  
  13129.           Returns:    This is a dialog type function. See Appendix "E" for
  13130.                       a description of the general operation of these
  13131.                       functions.  Returns the messages described in the
  13132.                       Messages section.
  13133.  
  13134.           Parameters: Dialog type functions receive messages and structures
  13135.                       as parameters. The options must be passed as a null
  13136.                       terminated array of structures of the type SData1,
  13137.                       one array element for each option:
  13138.  
  13139.           typedef struct{
  13140.               int Row;      Row position where the option is displayed.
  13141.  
  13142.               int Col;      Column position where the option is displayed.
  13143.  
  13144.               char *String; Pointer to the text used to identify the
  13145.                             option.
  13146.  
  13147.               }SData1;
  13148.  
  13149.           The general information about the Select options are included in
  13150.           a structure type SData2, as follows:
  13151.  
  13152.  
  13153.                     SCL1 Version 3.1 - Reference Manual - Page 214
  13154.  
  13155.  
  13156.  
  13157.  
  13158.  
  13159.  
  13160.  
  13161.                                                                      Select
  13162.  
  13163.           typedef struct{
  13164.               int Color;                Color for the display of the select
  13165.                                         options.
  13166.  
  13167.               int PRow;                 Row position where to display an
  13168.                                         optional prompt.
  13169.  
  13170.               int PCol;                 Column position where to display an
  13171.                                         optional prompt.
  13172.  
  13173.               char *Prompt;             Pointer to an optional prompt or
  13174.                                         option title.
  13175.  
  13176.               unsigned int *ExitKeys;   Array of keys defined as exit keys.
  13177.  
  13178.  
  13179.               int Options;              Number of options available.
  13180.  
  13181.               int Position;             Default selection.
  13182.  
  13183.               unsigned int EventInfo;   Will hold the last illegal or exit
  13184.                                         key pressed.
  13185.               }SData2;
  13186.  
  13187.           Messages:
  13188.  
  13189.           The messages that can be sent to the Select are:
  13190.  
  13191.               S_INIT - initialize the SData2 structure to NULL (the SData1
  13192.               structure must be initialized with the position and text
  13193.               information) and set the following default values:
  13194.  
  13195.                   Color - set to black characters in a white background or
  13196.                   the reversed color set by SetDialogColors.
  13197.  
  13198.                   ExitKeys - ENTER, ESC, TAB and SHIFT TAB.
  13199.  
  13200.               S_DRAW - draws the Select display.
  13201.  
  13202.               S_ACTIVE - activates the function.
  13203.  
  13204.               S_CHECK_MOUSE - check if the mouse has been clicked after
  13205.               pointing to the area defined by the function.
  13206.  
  13207.               S_RESET - when this message is sent the position variables
  13208.               are reset to the default value. If the exit keys have not
  13209.               been defined they are set to the default exit keys.
  13210.  
  13211.           The following messages can be returned by Select:
  13212.  
  13213.  
  13214.                     SCL1 Version 3.1 - Reference Manual - Page 215
  13215.  
  13216.  
  13217.  
  13218.  
  13219.  
  13220.  
  13221.  
  13222.                                                                      Select
  13223.  
  13224.               S_NULL_ARRAY - no select item array has been defined.
  13225.  
  13226.               S_OK - action requested was performed.
  13227.  
  13228.               S_EXIT_KEY - a key defined as an exit key has been pressed.
  13229.  
  13230.               S_MOUSE_EVENT - the mouse has been clicked but it has not
  13231.               been pointed to the area defined by the function.
  13232.  
  13233.               S_ILLEGAL_KEY - an illegal key has been pressed.
  13234.  
  13235.               S_NEW_POSITION - the cursor position has been updated.
  13236.  
  13237.               S_MY_MOUSE - response to a S_CHECK_MOUSE message if the mouse
  13238.               has been clicked after pointing to the area defined by the
  13239.               function.
  13240.  
  13241.           Example:
  13242.  
  13243.           #include <scl1.h>
  13244.           #include <scl1clor.h>
  13245.           #include <scl1keys.h>
  13246.  
  13247.           unsigned int MyExitKeys[]={ENTER,ESC,0};
  13248.  
  13249.           SData1 sd1[]={
  13250.               12,35,"Male",
  13251.               13,35,"Female",
  13252.               0};
  13253.  
  13254.           SData2 sd2={WHITE_BLACK,10,32,"Enter your sex:",MyExitKeys};
  13255.  
  13256.           main()
  13257.           {
  13258.           int Mess;
  13259.  
  13260.           Cls(WHITE_BLACK,0,0,24,79);
  13261.           WriteScreen(WHITE_BLACK,16,22,"  Use ARROW KEYS to select
  13262.                       option,\nPress ENTER to accept, ESC to cancel");
  13263.           Select(S_RESET,sd1,&sd2);
  13264.           sd2.ExitKeys=MyExitKeys;
  13265.  
  13266.           Select(S_DRAW,sd1,&sd2);
  13267.           do
  13268.               {
  13269.               Mess=Select(S_ACTIVE,sd1,&sd2);
  13270.               }while(Mess != S_EXIT_KEY);
  13271.  
  13272.  
  13273.  
  13274.  
  13275.                     SCL1 Version 3.1 - Reference Manual - Page 216
  13276.  
  13277.  
  13278.  
  13279.  
  13280.  
  13281.  
  13282.  
  13283.                                                    Select - SetBin2AsciiDel
  13284.  
  13285.           if(sd2.EventInfo != ESC)
  13286.               {
  13287.               if(sd2.Position==0)
  13288.                   WriteScreen(WHITE_BLACK+BLINK,19,32,"You are a male.");
  13289.               else
  13290.                   WriteScreen(WHITE_BLACK+BLINK,19,31,"You are a female");
  13291.               }
  13292.           else
  13293.               WriteScreen(WHITE_BLACK+BLINK,19,29,"Operation was
  13294.                          canceled");
  13295.  
  13296.           SetCurPos(20,0);
  13297.           exit(0);
  13298.           }
  13299.  
  13300.           -----------------------------------------------------------------
  13301.                                    SetBin2AsciiDel
  13302.           -----------------------------------------------------------------
  13303.  
  13304.           Purpose:    Permits changing the comma used to in the display of
  13305.                       numbers when using the Bin2Ascii function to periods.
  13306.                       Please refer to the Bin2Ascii function.
  13307.  
  13308.           Prototype:  void SetBin2AsciiDel(int Character);
  13309.  
  13310.           Returns:    Nothing
  13311.  
  13312.           Parameter:  Character - character to be used as a separator
  13313.           (integer).
  13314.  
  13315.           Example:
  13316.  
  13317.           #include <scl1.h>
  13318.  
  13319.           main()
  13320.           {
  13321.           long l,int i;
  13322.           char buffer[8];
  13323.  
  13324.           l=999999;
  13325.           Cls(7,CLS_ALL);
  13326.  
  13327.           SetBin2AsciiDel('.');
  13328.           for(i=0;i < 6;++i,l/=10)
  13329.             {
  13330.             WriteScreenLen(7,10,10,7,Bin2Ascii(l,buffer));
  13331.             GetKey();
  13332.             }
  13333.           }
  13334.  
  13335.  
  13336.                     SCL1 Version 3.1 - Reference Manual - Page 217
  13337.  
  13338.  
  13339.  
  13340.  
  13341.  
  13342.  
  13343.  
  13344.                                                      SetCurPos - SetCurSize
  13345.           -----------------------------------------------------------------
  13346.                                       SetCurPos
  13347.           -----------------------------------------------------------------
  13348.  
  13349.           Purpose:    Sets the cursor position.
  13350.  
  13351.           Prototype:  void SetCurPos(int Row, int Col);
  13352.  
  13353.           Returns:    Nothing
  13354.  
  13355.           Parameters:
  13356.  
  13357.               Row - the desired row position (integer).
  13358.  
  13359.               Col - the desired column position (integer).
  13360.  
  13361.           Example:    See PopCursor
  13362.  
  13363.                                                                  SetCurSize
  13364.           -----------------------------------------------------------------
  13365.                                       SetCurSize
  13366.           -----------------------------------------------------------------
  13367.  
  13368.           Purpose:    Sets the cursor size.
  13369.  
  13370.           Prototype:  void SetCurSize(int CursorSize);
  13371.  
  13372.           Returns:    Nothing
  13373.  
  13374.           Parameter:  CursorSize - the desired cursor size, an unsigned
  13375.                       integer value that contains the scan start and end
  13376.                       line. To determine this value use the following
  13377.                       formula: Size = StartLine*256+EndLine. The start and
  13378.                       end lines for MONOCHROME monitors are from "0" to
  13379.                       "13" and for COLOR monitors from "0" to "7".
  13380.  
  13381.           Example:
  13382.  
  13383.           #include <scl1.h>
  13384.  
  13385.           main()
  13386.           {
  13387.           int topline,bottomline;
  13388.  
  13389.           InitVideo();
  13390.           topline=0;
  13391.  
  13392.           if(Video()==COLOR)
  13393.               bottomline=7;
  13394.           else
  13395.               bottomline=13;
  13396.  
  13397.                     SCL1 Version 3.1 - Reference Manual - Page 218
  13398.  
  13399.  
  13400.  
  13401.  
  13402.  
  13403.  
  13404.  
  13405.                              SetCurSize - SetDialogColor - SetErrorBoxColor
  13406.  
  13407.           printf("\nYour cursor will start growing: ");
  13408.           for(topline=bottomline-1;topline > 0;--topline)
  13409.               {
  13410.               SetCurSize(topline * 256 + bottomline);
  13411.               WaitTime(50);
  13412.               }
  13413.  
  13414.           printf("\nYour cursor will now return to normal: ");
  13415.           for(;topline < bottomline;++topline)
  13416.               {
  13417.               SetCurSize(topline * 256 + bottomline);
  13418.               WaitTime(50);
  13419.               }
  13420.           }
  13421.  
  13422.           -----------------------------------------------------------------
  13423.                                     SetDialogColor
  13424.           -----------------------------------------------------------------
  13425.  
  13426.           Purpose:    Lets you define the colors that will be used when
  13427.                       initializing any dialog function structure.
  13428.  
  13429.           Prototype:  void SetDialogColor(int NColor,int RColor,
  13430.                          int HColor);
  13431.  
  13432.           Returns:    Nothing
  13433.  
  13434.           Parameters:
  13435.  
  13436.               NColor - normal color for the dialog functions (integer).
  13437.  
  13438.               RColor - reversed color for the dialog functions (integer).
  13439.  
  13440.               HColor - highlight color for the dialog functions (integer).
  13441.  
  13442.  
  13443.           -----------------------------------------------------------------
  13444.                                    SetErrorBoxColor
  13445.           -----------------------------------------------------------------
  13446.  
  13447.           Purpose:    Lets you define the color for the Error Box function.
  13448.  
  13449.           Prototype:  void SetErrorBoxColor(int UColor)
  13450.  
  13451.           Returns:    Nothing
  13452.  
  13453.           Parameter:  UColor - color for Error Box messages (integer).
  13454.  
  13455.           See also ErrorBox.
  13456.  
  13457.  
  13458.                     SCL1 Version 3.1 - Reference Manual - Page 219
  13459.  
  13460.  
  13461.  
  13462.  
  13463.  
  13464.  
  13465.  
  13466.                                                                 SetFileMode
  13467.           -----------------------------------------------------------------
  13468.                                      SetFileMode
  13469.           -----------------------------------------------------------------
  13470.  
  13471.           Purpose:    Sets a file's attributes (system, hidden, read only,
  13472.                       etc.).
  13473.  
  13474.           Prototype:  int SetFileMode(char *Filename, int NewMode);
  13475.  
  13476.           Returns:    The DOS error code or "0" if no error occurs. (See
  13477.                       Appendix "A", FILE FUNCTIONS, for more information).
  13478.  
  13479.           Parameters: A mask has been defined in SCL1.H (see GetFileMode):
  13480.                       They can be "ored" to "add" several attributes.
  13481.  
  13482.           Example:
  13483.  
  13484.           #include <scl1.h>
  13485.           char Filename[]="FILE.1";
  13486.  
  13487.           main()
  13488.           {
  13489.           int handle;
  13490.           unsigned int FMode;
  13491.           if(CreateFile(Filename,&handle,F_ARCHIVE))
  13492.               exit(-1);
  13493.           if(GetFileMode(Filename,&FMode))
  13494.               exit(-1);
  13495.           PrintFMode(FMode);
  13496.           if(SetFileMode(Filename,F_READ_ONLY | F_SYSTEM | F_HIDDEN))
  13497.               exit(-1);
  13498.           if(GetFileMode(Filename,&FMode))
  13499.               exit(-1);
  13500.           PrintFMode(FMode);
  13501.           if(SetFileMode(Filename,F_ARCHIVE))
  13502.               exit(-1);
  13503.           DeleteFile(Filename);
  13504.           }
  13505.  
  13506.           PrintFMode(unsigned int FMode)
  13507.           {
  13508.           printf("\nFile attributes:\n\n");
  13509.           if(FMode & F_READ_ONLY)
  13510.               printf("\tRead Only\n");
  13511.           if(FMode & F_HIDDEN)
  13512.               printf("\tHidden\n");
  13513.           if(FMode & F_SYSTEM)
  13514.               printf("\tSystem\n");
  13515.           if(FMode & F_ARCHIVE)
  13516.               printf("\tArchive\n");
  13517.           }
  13518.  
  13519.                     SCL1 Version 3.1 - Reference Manual - Page 220
  13520.  
  13521.  
  13522.  
  13523.  
  13524.  
  13525.  
  13526.  
  13527.                                                   SetHorLimit - SetVerLimit
  13528.           -----------------------------------------------------------------
  13529.                                SetHorLimit, SetVerLimit
  13530.           -----------------------------------------------------------------
  13531.  
  13532.           Purpose:    Sets the minimum and maximum mouse horizontal
  13533.                       position (SetHorLimit) or verical position
  13534.                       (SetVerLimit).
  13535.  
  13536.           Prototype:  void SetHorLimit(int Minimum,int Maximum);
  13537.                       void SetVerLimit(int Minimum,int Maximum);
  13538.  
  13539.           Returns:    Nothing
  13540.  
  13541.           Parameters:
  13542.  
  13543.               Minimum - integer value indicating the minimum position.
  13544.  
  13545.               Maximum - integer value indicating the maximum position.
  13546.  
  13547.           Example:
  13548.  
  13549.           #include <scl1.h>
  13550.  
  13551.           main()
  13552.           {
  13553.           InitMouse(IM_SHOW);
  13554.           if(MSE_MouseFl)
  13555.               {
  13556.               SetHorLimit(39,39);
  13557.               printf("Mouse movement has been limited to column 39");
  13558.  
  13559.               SetVerLimit(11,11);
  13560.               printf("Mouse movement has been limited to line 11");
  13561.  
  13562.               while(!MSE_LPress);
  13563.               }
  13564.           else
  13565.               printf("No mouse installed\n");
  13566.           }
  13567.  
  13568.  
  13569.  
  13570.  
  13571.  
  13572.  
  13573.  
  13574.  
  13575.  
  13576.  
  13577.  
  13578.  
  13579.  
  13580.                     SCL1 Version 3.1 - Reference Manual - Page 221
  13581.  
  13582.  
  13583.  
  13584.  
  13585.  
  13586.  
  13587.  
  13588.                                  SetInt24Colors - SetMouseCur - SetMouseIsr
  13589.           -----------------------------------------------------------------
  13590.                                     SetInt24Colors
  13591.           -----------------------------------------------------------------
  13592.  
  13593.           Purpose:    Lets you define the color for the error display box
  13594.                       used by the TrapInt24 function.
  13595.  
  13596.           Prototype:  void SetInt24Colors(int NColor, int RColor);
  13597.  
  13598.           Returns:    Nothing
  13599.  
  13600.           Parameters:
  13601.  
  13602.               NColor - normal color for the TrapInt24 error display (int).
  13603.  
  13604.               RColor - reversed color for the TrapInt24 error display
  13605.               (integer).
  13606.  
  13607.  
  13608.           -----------------------------------------------------------------
  13609.                                      SetMouseCur
  13610.           -----------------------------------------------------------------
  13611.  
  13612.           Purpose:    Sets mouse cursor. Any valid character can be used as
  13613.                       the mouse cursor.
  13614.  
  13615.           Prototype:  void SetMouseCur(int Character);
  13616.  
  13617.           Returns:    Nothing
  13618.  
  13619.           Parameter:  Character - character to be used as the mouse cursor
  13620.                       (int).
  13621.  
  13622.           Example:    See ResetMouseCur
  13623.  
  13624.  
  13625.           -----------------------------------------------------------------
  13626.                                      SetMouseIsr
  13627.           -----------------------------------------------------------------
  13628.  
  13629.           Purpose:    Sets an interrupt service routine that is called when
  13630.                       the mouse moves or any of its buttons is pressed or
  13631.                       released.
  13632.  
  13633.           Prototype:  void SetMouseIsr(void);
  13634.  
  13635.           Returns:    Nothing
  13636.  
  13637.           The following variables are set according to the mouse status:
  13638.  
  13639.               MSE_LPress is set to "1" when the left button is pressed.
  13640.  
  13641.                     SCL1 Version 3.1 - Reference Manual - Page 222
  13642.  
  13643.  
  13644.  
  13645.  
  13646.  
  13647.  
  13648.  
  13649.                                                                 SetMouseIsr
  13650.  
  13651.               MSE_LpX is set to the mouse cursor's horizontal position when
  13652.               the left mouse button is pressed.
  13653.  
  13654.               MSE_LpY is set to the mouse cursor's vertical position when
  13655.               the left mouse button is pressed.
  13656.  
  13657.               MSE_LRel is set to "1" when the left button is released.
  13658.  
  13659.               MSE_LrX is set to the mouse cursor's horizontal position when
  13660.               the left mouse button is released.
  13661.  
  13662.               MSE_LrY is set to the mouse cursor's vertical position when
  13663.               the left mouse button is released.
  13664.  
  13665.               MSE_RPress is set to "1" when the right button is pressed.
  13666.  
  13667.               MSE_RpX is set to the mouse cursor's horizontal position when
  13668.               the right mouse button is pressed.
  13669.  
  13670.               MSE_RpY is set to the mouse cursor's vertical position when
  13671.               the right mouse button is pressed.
  13672.  
  13673.               MSE_RRel is set to "1" when the right button is released.
  13674.  
  13675.               MSE_RrX is set to the mouse cursor's horizontal position when
  13676.               the right mouse button is released.
  13677.  
  13678.               MSE_RrY is set to the mouse cursor's vertical position when
  13679.               the right mouse button is released.
  13680.  
  13681.               MSE_Move is set to "1" when the mouse is moved.
  13682.  
  13683.               MSE_MoveX holds the actual mouse cursor's horizontal
  13684.               position.
  13685.  
  13686.               MSE_MoveY holds the actual mouse cursor's vertical position.
  13687.  
  13688.               MSE_DoubleClick is set to "1" when you double click the left
  13689.               mouse button.
  13690.  
  13691.               MSE_MouseFl is set to "1" when the mouse driver is present.
  13692.  
  13693.           Before ending your program you must Reset the mouse using
  13694.           ResetMouse or disable the interrupt service routine using
  13695.           DisableMouseIsr or ResetMouse.
  13696.  
  13697.           Example:    See CheckMouse
  13698.  
  13699.  
  13700.  
  13701.  
  13702.                     SCL1 Version 3.1 - Reference Manual - Page 223
  13703.  
  13704.  
  13705.  
  13706.  
  13707.  
  13708.  
  13709.  
  13710.                                                                 SetMousePos
  13711.           -----------------------------------------------------------------
  13712.                                      SetMousePos
  13713.           -----------------------------------------------------------------
  13714.  
  13715.           Purpose:    Sets the mouse cursor position.
  13716.  
  13717.           Prototype:  void SetMousePos(int X, int Y);
  13718.  
  13719.           Returns:    Nothing
  13720.  
  13721.           Parameters:
  13722.  
  13723.               X - integer value indicating the horizontal position.
  13724.  
  13725.               Y - integer value indicating the vertical position.
  13726.  
  13727.           Example:
  13728.  
  13729.           #include <scl1.h>
  13730.           #include <scl1clor.h>
  13731.  
  13732.           main()
  13733.           {
  13734.           GSSBox(WHITE_BLACK,0,0,0,24,79,1,0,0);
  13735.           InitMouse(IM_SHOW);
  13736.           if(MSE_MouseFl)
  13737.               {
  13738.               SetMousePos(1,1);
  13739.               WriteScreen(WHITE_BLACK+HIGHLIGHT,23,2,"Mouse cursor position
  13740.                           (X,Y) = 1,1");
  13741.               WaitTime(200);
  13742.               SetMousePos(39,12);
  13743.               WriteScreen(WHITE_BLACK+HIGHLIGHT,23,2,"Mouse cursor position
  13744.                           (X,Y) = 39,12");
  13745.               WaitTime(200);
  13746.               SetMousePos(78,23);
  13747.               WriteScreen(WHITE_BLACK+HIGHLIGHT,23,2,"Mouse cursor position
  13748.                           (X,Y) = 78,23");
  13749.               WaitTime(200);
  13750.               }
  13751.           else
  13752.               WriteScreen(WHITE_BLACK+HIGHLIGHT,23,2,"No mouse
  13753.                          installed.");
  13754.           }
  13755.  
  13756.  
  13757.  
  13758.  
  13759.  
  13760.  
  13761.  
  13762.  
  13763.                     SCL1 Version 3.1 - Reference Manual - Page 224
  13764.  
  13765.  
  13766.  
  13767.  
  13768.  
  13769.  
  13770.  
  13771.                                                 SetShadowColor - SetUserBox
  13772.           -----------------------------------------------------------------
  13773.                                     SetShadowColor
  13774.           -----------------------------------------------------------------
  13775.  
  13776.           Purpose:    Sets the shadow color. For functions that support a
  13777.                       shadow effect, this function will permit you to
  13778.                       select the color to be XOR'ed with the background
  13779.                       color to produce a pleasing effect. You must specify
  13780.                       the color in these functions as "0". If you prefer a
  13781.                       solid color for the shadow effect you should specify
  13782.                       it as a color parameter when calling the function.
  13783.  
  13784.           Prototype:  void SetShadowColor(int Color);
  13785.  
  13786.           Returns:    Nothing
  13787.  
  13788.           Parameter:  Color - color attribute for the shadow effect (to be
  13789.                       XOR'ed with the background color) (integer).
  13790.  
  13791.           Example:    See Shadow
  13792.  
  13793.           -----------------------------------------------------------------
  13794.                                       SetUserBox
  13795.           -----------------------------------------------------------------
  13796.  
  13797.           Purpose:    Lets you define a different frame type than those
  13798.                       available for the Box and GSSBox functions. You must
  13799.                       specify this frame as number 12 in these functions.
  13800.  
  13801.           Prototype:  void SetUserBox(int UpperLeft,int UpperRight,
  13802.                          int LowerLeft, int LowerRight,int UpperSide,
  13803.                          int BottomSide,int LeftSide,int RightSide);
  13804.  
  13805.           Returns:    Nothing
  13806.  
  13807.           Parameters:
  13808.  
  13809.               UpperLeft - character for the upper left corner of the box
  13810.               frame (integer).
  13811.  
  13812.               UpperRight - character for the upper right corner of the box
  13813.               frame (integer).
  13814.  
  13815.               LowerLeft - character for the lower left corner of the box
  13816.               frame (integer).
  13817.  
  13818.               LowerRight - character for the lower right corner of the box
  13819.               frame (integer).
  13820.  
  13821.               UpperSide - characters to be used for drawing the upper
  13822.               border of the box frame (integer).
  13823.  
  13824.                     SCL1 Version 3.1 - Reference Manual - Page 225
  13825.  
  13826.  
  13827.  
  13828.  
  13829.  
  13830.  
  13831.  
  13832.                                                 SetUserBox - SetUserBoxLine
  13833.  
  13834.               BottomSide - characters to be used for drawing the bottom
  13835.               border of the box frame (integer).
  13836.  
  13837.               LeftSide - characters to be used for drawing the left border
  13838.               of the box frame (integer).
  13839.  
  13840.               RightSide - characters to be used for drawing the right
  13841.               border of the box frame (integer).
  13842.  
  13843.           Example:
  13844.  
  13845.           #include <scl1.h>
  13846.           #include <scl1clor.h>
  13847.  
  13848.           main()
  13849.           {
  13850.           SetUserBox(21,21,21,21,21,21,21,21);
  13851.           GSSBox(BLACK_WHITE,12,2,2,22,77,1,0,0);
  13852.           }
  13853.  
  13854.           -----------------------------------------------------------------
  13855.                                     SetUserBoxLine
  13856.           -----------------------------------------------------------------
  13857.  
  13858.           Purpose:    Lets you define a line type for drawing lines inside
  13859.                       boxes that use lines defined by using the SetUserBox
  13860.                       function.
  13861.  
  13862.           Prototype:  void SetUserBoxLine(int HLeft,int HRight,int VUpper,
  13863.                          int VLower);
  13864.  
  13865.           Returns:    Nothing
  13866.  
  13867.           Parameters:
  13868.  
  13869.               HLeft - horizontal left line terminating character  (int).
  13870.  
  13871.               HRight - horizontal right line terminating character (int).
  13872.  
  13873.               VUpper - vertical upper line terminating character (integer).
  13874.  
  13875.               VLower - vertical lower line terminating character (integer).
  13876.  
  13877.           Example:
  13878.  
  13879.           This example call will set a user type frame to double line, as
  13880.           defined in standard frame type 0 of the Box and GSSBox functions
  13881.  
  13882.               SetUserBoxLine(201,188,200,189,205,205,186,186);
  13883.  
  13884.  
  13885.                     SCL1 Version 3.1 - Reference Manual - Page 226
  13886.  
  13887.  
  13888.  
  13889.  
  13890.  
  13891.  
  13892.  
  13893.                                                                SetVideoMode
  13894.           -----------------------------------------------------------------
  13895.                                      SetVideoMode
  13896.           -----------------------------------------------------------------
  13897.  
  13898.           Purpose:    Sets the desired video mode.  See the BIOS reference
  13899.                       manual for the available video modes. SCL1 only
  13900.                       supports the 40 and 80 column text modes.
  13901.  
  13902.           Prototype:  void SetVideoMode(int NewMode);
  13903.  
  13904.           Returns:    Nothing
  13905.  
  13906.           Parameter:  NewMode - video mode as defined by the DOS (integer).
  13907.  
  13908.           Example:
  13909.  
  13910.           #include <scl1.h>
  13911.  
  13912.           /* Initializes Video mode to mode 3 in case of color, EGA or VGA
  13913.               or to mode 7 in case mono */
  13914.  
  13915.           void InitVideo(void)
  13916.           {
  13917.  
  13918.           Video();
  13919.           if(VC_Segment==COLOR)
  13920.               SetVideoMode(3);
  13921.           else
  13922.               SetVideoMode(7);
  13923.           }
  13924.  
  13925.  
  13926.  
  13927.  
  13928.  
  13929.  
  13930.  
  13931.  
  13932.  
  13933.  
  13934.  
  13935.  
  13936.  
  13937.  
  13938.  
  13939.  
  13940.  
  13941.  
  13942.  
  13943.  
  13944.  
  13945.  
  13946.                     SCL1 Version 3.1 - Reference Manual - Page 227
  13947.  
  13948.  
  13949.  
  13950.  
  13951.  
  13952.  
  13953.  
  13954.                                                                SetVideoPage
  13955.           -----------------------------------------------------------------
  13956.                                      SetVideoPage
  13957.           -----------------------------------------------------------------
  13958.  
  13959.           Purpose:    Sets the active video page.  See the BIOS reference
  13960.                       manual for the available video pages.
  13961.  
  13962.           Prototype:  void SetVideoPage(int NewPage);
  13963.  
  13964.           Returns:    Nothing
  13965.  
  13966.           Parameter:  NewPage - video page (supported by your display
  13967.                       adapter) as defined in the BIOS (integer).
  13968.  
  13969.           Example:
  13970.  
  13971.           #include <scl1.h>
  13972.           #include <scl1clor.h>
  13973.  
  13974.           main()
  13975.           {
  13976.           Video();
  13977.           if(VC_Monitor==VC_MDA)
  13978.               {
  13979.               printf("Monochrome monitors do not support video pages\n");
  13980.               exit(-1);
  13981.               }
  13982.           Cls(WHITE_BLACK,CLS_ALL);
  13983.           WriteScreen(WHITE_BLACK,10,35,"Video page 0");
  13984.           WaitTime(100);
  13985.           SetVideoPage(1);
  13986.           Cls(BLACK_WHITE,CLS_ALL);
  13987.           WriteScreen(BLACK_WHITE,10,35,"Video page 1");
  13988.           WaitTime(100);
  13989.           SetVideoPage(0);
  13990.           WaitTime(100);
  13991.           SetVideoPage(1);
  13992.           WaitTime(100);
  13993.           SetVideoPage(0);
  13994.           }
  13995.  
  13996.  
  13997.  
  13998.  
  13999.  
  14000.  
  14001.  
  14002.  
  14003.  
  14004.  
  14005.  
  14006.  
  14007.                     SCL1 Version 3.1 - Reference Manual - Page 228
  14008.  
  14009.  
  14010.  
  14011.  
  14012.  
  14013.  
  14014.  
  14015.                                      SetVideo25 - SetVideo28 - SetVideo4350
  14016.           -----------------------------------------------------------------
  14017.                          SetVideo25, SetVideo28, SetVideo4350
  14018.           -----------------------------------------------------------------
  14019.  
  14020.           Purpose:    SetVideo4350 sets the display mode to 43 lines (EGA
  14021.                       and VGA display adapters) or to 50 lines (VGA display
  14022.                       adapters). SetVideo28 sets the display mode to 28
  14023.                       lines (VGA displays). SetVideo25 resets the display
  14024.                       mode to 25 lines.
  14025.  
  14026.           Prototype:  void SetVideo25(void);
  14027.                       void SetVideo28(void);
  14028.                       void SetVideo4350();
  14029.  
  14030.           Returns:    Nothing
  14031.  
  14032.           Parameters: None
  14033.  
  14034.           Example:
  14035.  
  14036.           #include <scl1.h>
  14037.           #include <scl1clor.h>
  14038.  
  14039.           main()
  14040.           {
  14041.           Video();
  14042.           if(VC_Monitor != VC_VGA && VC_Monitor != VC_EGA)
  14043.               {
  14044.               printf("Video system does not supports 43/50 lines video
  14045.                        mode\n");
  14046.               exit(-1);
  14047.               }
  14048.           SetVideo4350();
  14049.           FillBlock(WHITE_BLACK,0,0,VC_Lines-1,79,'*');
  14050.           MessageOn(BLACK_WHITE,"43/50 lines Video Mode\n
  14051.                       press any key...");
  14052.           GetKey();
  14053.  
  14054.           SetVideo25();
  14055.           FillBlock(WHITE_BLACK,0,0,VC_Lines-1,79,'*');
  14056.           MessageOn(BLACK_WHITE,"25 lines Video Mode\npress any key...");
  14057.           GetKey();
  14058.  
  14059.           Cls(7,CLS_ALL);
  14060.           }
  14061.  
  14062.  
  14063.  
  14064.  
  14065.  
  14066.  
  14067.  
  14068.                     SCL1 Version 3.1 - Reference Manual - Page 229
  14069.  
  14070.  
  14071.  
  14072.  
  14073.  
  14074.  
  14075.  
  14076.                                                                      Shadow
  14077.           -----------------------------------------------------------------
  14078.                                         Shadow
  14079.           -----------------------------------------------------------------
  14080.  
  14081.           Purpose:    Draws a shadow to a screen area.
  14082.  
  14083.           Prototype:  void Shadow(int Color,int UpperRow,int LeftCol,
  14084.                          int LowerRow,int RightCol);
  14085.  
  14086.           Returns:    Nothing
  14087.  
  14088.           Parameters:
  14089.  
  14090.               Color - color attribute of the desired shadow effect. A value
  14091.               of "0" will set the shadow effect XOR'ed to the screen area.
  14092.               Use SetShadowColor to specify the shadow color (integer).
  14093.  
  14094.               UpperRow - upper row position of the area (integer).
  14095.  
  14096.               LeftCol - left column position of the area (integer).
  14097.  
  14098.               LowerRow - lower row position of the area (integer).
  14099.  
  14100.               RightCol - right column position of the area (integer).
  14101.  
  14102.           Example:    See SetShadowColor
  14103.  
  14104.           #include <scl1.h>
  14105.           #include <scl1clor.h>
  14106.  
  14107.           main()
  14108.           {
  14109.           FillBlock(WHITE_BLACK+HIGHLIGHT,0,0,24,79,'X');
  14110.           GSSBox(WHITE_BLACK+HIGHLIGHT,0,5,20,20,60,1,0,0);
  14111.           SetShadowColor(BLACK_WHITE);
  14112.           Shadow(0,5,20,20,60);
  14113.           GetKey();
  14114.           SetShadowColor(WHITE_BLACK);
  14115.           Shadow(0,5,20,20,60);
  14116.           GetKey();
  14117.           SetShadowColor(BLACK_BLACK+HIGHLIGHT);
  14118.           Shadow(0,5,20,20,60);
  14119.           }
  14120.  
  14121.  
  14122.  
  14123.  
  14124.  
  14125.  
  14126.  
  14127.  
  14128.  
  14129.                     SCL1 Version 3.1 - Reference Manual - Page 230
  14130.  
  14131.  
  14132.  
  14133.  
  14134.  
  14135.  
  14136.  
  14137.                                                                   ShellSort
  14138.           -----------------------------------------------------------------
  14139.                                       ShellSort
  14140.           -----------------------------------------------------------------
  14141.  
  14142.           Purpose:    Sort an array using a shell-sort algorithm. It
  14143.                       overwrites the unsorted array with the sorted
  14144.                       elements.
  14145.  
  14146.           Prototype:  int ShellSort(void *base,unsigned int num,
  14147.                          unsigned int width, int (*compare)(void
  14148.                          *elem1,void *elem2));
  14149.  
  14150.           Returns:    Returns "-1" if there is not enough memory or if the
  14151.                       array to sort has only one element. Returns "0" if
  14152.                       successful.
  14153.  
  14154.           Parameters:
  14155.  
  14156.               *compare - pointer to a user-supplied function that compares
  14157.               two array elements and returns a value indicating their
  14158.               relationship. ShellSort calls this compare routine and passes
  14159.               pointers to two array elements. For an ascending sorting
  14160.               order the compare function must return "0" if both elements
  14161.               are equal, a positive value (>0) if element1 is greater than
  14162.               element2 or a negative value (<0) if element1 is less than
  14163.               element2. For a descending sorting order the compare function
  14164.               must reverse the "greater than" and "less than" return
  14165.               values.
  14166.  
  14167.               base - pointer to the base of the array to be sorted.
  14168.  
  14169.  
  14170.  
  14171.  
  14172.  
  14173.  
  14174.  
  14175.  
  14176.  
  14177.  
  14178.  
  14179.  
  14180.  
  14181.  
  14182.  
  14183.  
  14184.  
  14185.  
  14186.  
  14187.  
  14188.  
  14189.  
  14190.                     SCL1 Version 3.1 - Reference Manual - Page 231
  14191.  
  14192.  
  14193.  
  14194.  
  14195.  
  14196.  
  14197.  
  14198.                                                                   ShellSort
  14199.  
  14200.               num - number of elements to be sorted (unsigned integer).
  14201.  
  14202.               width - size in bytes of each array element (unsigned
  14203.               integer).
  14204.  
  14205.           Example:
  14206.  
  14207.           #include <scl1.h>
  14208.           #include <scl1clor.h>
  14209.           #include <string.h>
  14210.  
  14211.           int compare(void *elem1,void *elem2);
  14212.  
  14213.           typedef struct{
  14214.               char line[16];
  14215.               }LINE;
  14216.  
  14217.           LINE lines[]=
  14218.               {"******",
  14219.               "************",
  14220.               "*****",
  14221.               "**************",
  14222.               "*",
  14223.               "*********",
  14224.               "*******",
  14225.               "***********",
  14226.               "*************",
  14227.               "********",
  14228.               "****",
  14229.               "***************",
  14230.               "***",
  14231.               "**********",
  14232.               "**",};
  14233.  
  14234.           #define LINES sizeof(lines) / sizeof(LINE)
  14235.  
  14236.           main()
  14237.           {
  14238.           Cls(WHITE_BLACK,CLS_ALL);
  14239.           ShellSort(lines,LINES,sizeof(LINE),compare);
  14240.           DrawLines();
  14241.           }
  14242.  
  14243.           DrawLines()
  14244.           {
  14245.           int i;
  14246.           for(i=0;i < LINES;i++)
  14247.               WriteScreenLen(WHITE_BLACK,i+4,30,sizeof(LINE),
  14248.                          (char *)&lines[i]);
  14249.           }
  14250.  
  14251.                     SCL1 Version 3.1 - Reference Manual - Page 232
  14252.  
  14253.  
  14254.  
  14255.  
  14256.  
  14257.  
  14258.  
  14259.                                                    ShellSort - SortPointers
  14260.  
  14261.           int compare(void *elem1,void *elem2)
  14262.           {
  14263.           DrawLines();
  14264.           WaitTime(10);
  14265.           return(strcmp((char *)elem1,(char *)elem2));
  14266.           }
  14267.  
  14268.  
  14269.           -----------------------------------------------------------------
  14270.                                      SortPointers
  14271.           -----------------------------------------------------------------
  14272.  
  14273.           Purpose:    Sorts, in alphabetical order, a null terminated array
  14274.                       of strings.
  14275.  
  14276.           Prototype:  void SortPointers(char *p[]);
  14277.  
  14278.           Returns:    Nothing
  14279.  
  14280.           Parameter:  p - pointer to a null terminated array of char
  14281.                       pointers.
  14282.  
  14283.           Example:
  14284.  
  14285.           #include <scl1.h>
  14286.  
  14287.               /* SortPointers demo */
  14288.  
  14289.           char *names[]={
  14290.               "Mozart",
  14291.               "Villa-Lobos",
  14292.               "Chopin",
  14293.               "Bach",
  14294.               "Schubert",
  14295.               "Debussy",
  14296.               "Albeniz",
  14297.               "Beethoven",
  14298.               "Falla",0,};
  14299.  
  14300.           main()
  14301.           {
  14302.           int i;
  14303.  
  14304.           SortPointers(names);
  14305.           for(i=0;names[i];++i)
  14306.               printf("%s\n",names[i]);
  14307.           }
  14308.  
  14309.  
  14310.  
  14311.  
  14312.                     SCL1 Version 3.1 - Reference Manual - Page 233
  14313.  
  14314.  
  14315.  
  14316.  
  14317.  
  14318.  
  14319.  
  14320.                                                  Sound - SoundOff - SoundOn
  14321.           -----------------------------------------------------------------
  14322.                                         Sound
  14323.           -----------------------------------------------------------------
  14324.  
  14325.           Purpose:    Sets a sound frequency.
  14326.  
  14327.           Prototype:  void Sound(int Freq);
  14328.  
  14329.           Returns:    Nothing
  14330.  
  14331.           Parameter:  Freq - the desired frequency in hertz (integer).
  14332.  
  14333.           Example:
  14334.  
  14335.           #include <scl1.h>
  14336.  
  14337.           main()
  14338.           {
  14339.           SoundOn();
  14340.           for(Freq=400;Freq<2000;Freq+=100)
  14341.               {
  14342.               Sound(Freq);
  14343.               WaitTime(10);
  14344.               }
  14345.           SoundOff();
  14346.               }
  14347.  
  14348.           See the note definitions in header file SCL1SND.H.
  14349.  
  14350.           -----------------------------------------------------------------
  14351.                                   SoundOff, SoundOn
  14352.           -----------------------------------------------------------------
  14353.  
  14354.           Purpose:    Turns the speaker Off or On.
  14355.  
  14356.           Prototype:  void SoundOff(void);
  14357.                       void SoundOn(void);
  14358.  
  14359.           Returns:    Nothing
  14360.  
  14361.           Parameters: None
  14362.  
  14363.           Example:    See Sound
  14364.  
  14365.  
  14366.  
  14367.  
  14368.  
  14369.  
  14370.  
  14371.  
  14372.  
  14373.                     SCL1 Version 3.1 - Reference Manual - Page 234
  14374.  
  14375.  
  14376.  
  14377.  
  14378.  
  14379.  
  14380.  
  14381.                                                                   StopWatch
  14382.           -----------------------------------------------------------------
  14383.                                       StopWatch
  14384.           -----------------------------------------------------------------
  14385.  
  14386.           Purpose:    Measures elapsed time in 1/100 seconds
  14387.  
  14388.           Prototype:  long StopWatch(int Function);
  14389.  
  14390.           Returns:    Elapsed Time between calls to the function. The stop
  14391.                       watch is started by calling the function with the
  14392.                       SW_START parameter. Every time the stop watch is
  14393.                       stopped by calling the function with the SW_STOP
  14394.                       parameter it returns the elapsed time.
  14395.  
  14396.           Parameters: See the above explanation.
  14397.  
  14398.           Example:
  14399.  
  14400.           #include <scl1.h>
  14401.  
  14402.           main()
  14403.           {
  14404.           unsigned int i;
  14405.           register unsigned int j;
  14406.           long t;
  14407.  
  14408.           StopWatch(SW_START);
  14409.           for(i=0;i < 65535;++i);
  14410.           t=StopWatch(SW_STOP);
  14411.           printf("Your computer needs %li/100 of a second to count from
  14412.                        1 to 65535.\n",t);
  14413.  
  14414.           StopWatch(SW_START);
  14415.           for(j=0;j < 65535;++j);
  14416.           t=StopWatch(SW_STOP);
  14417.           printf("This time can be reduced to %li/100 of a second by using
  14418.                       a register variable.\n",t);
  14419.           }
  14420.  
  14421.  
  14422.  
  14423.  
  14424.  
  14425.  
  14426.  
  14427.  
  14428.  
  14429.  
  14430.  
  14431.  
  14432.  
  14433.  
  14434.                     SCL1 Version 3.1 - Reference Manual - Page 235
  14435.  
  14436.  
  14437.  
  14438.  
  14439.  
  14440.  
  14441.  
  14442.                                                                     TagItem
  14443.           -----------------------------------------------------------------
  14444.                                        TagItem
  14445.           -----------------------------------------------------------------
  14446.  
  14447.           Purpose:    Displays one item and permits the user to tag or
  14448.                       untag it. Tag or untag an item by pressing the
  14449.                       SPACEBAR or by clicking the left mouse button after
  14450.                       pointing it. An item that has been tagged will be
  14451.                       displayed with a check mark (√) between parenthesis.
  14452.                       It can either be used alone or as one of the field
  14453.                       types for the Fields2 function.
  14454.  
  14455.           Prototype:  int TagItem(int Message, TIData *tg)
  14456.  
  14457.           Returns:    This is a dialog type function. See Appendix "E" for
  14458.                       a description of the general operation of these
  14459.                       functions. It can return a message described in the
  14460.                       Messages section.
  14461.  
  14462.           Parameters: Dialog type functions receive messages and structures
  14463.                       as parameters. The TagItem parameters must be passed
  14464.                       to a structure of the type TIData as follows.
  14465.  
  14466.           typedef struct{
  14467.               int Color;                color for the display of the
  14468.                                         TagItem.
  14469.  
  14470.               int Row;                  row where the item is displayed.
  14471.  
  14472.               int Col;                  column where the item is displayed.
  14473.  
  14474.               int TagFl;                flag that will have a value of "1"
  14475.                                         if the item has been tagged and a
  14476.                                         value of "0" if it has not been
  14477.                                         tagged.
  14478.  
  14479.               char *String;             char pointer to the text used to
  14480.                                         identify the TagItem.
  14481.  
  14482.               unsigned int *ExitKeys;   array of keys defined as exit keys.
  14483.  
  14484.               unsigned int EventInfo;   structure element that will hold
  14485.                                         the last key pressed.
  14486.               }TIData;
  14487.  
  14488.           Messages:
  14489.  
  14490.           The following messages can be sent to TagItem:
  14491.  
  14492.               TI_INIT - initialize the TIData structure to NULL and set the
  14493.               following default values:
  14494.  
  14495.                     SCL1 Version 3.1 - Reference Manual - Page 236
  14496.  
  14497.  
  14498.  
  14499.  
  14500.  
  14501.  
  14502.  
  14503.                                                                     TagItem
  14504.  
  14505.                   Color - set to white characters in a black background or
  14506.                   the normal color set by SetDialogColors.
  14507.  
  14508.               TI_DRAW - display the Tag Item with the current information.
  14509.  
  14510.               TI_ACTIVE - take control to tag an item.
  14511.  
  14512.               TI_CHECK_MOUSE - check if the mouse has been clicked after
  14513.               pointing to the area defined by the function.
  14514.  
  14515.               TI_RESET - when this message is sent the position variables
  14516.               are reset to the default value. If the exit keys have not
  14517.               been defined they are set to the default exit keys.
  14518.  
  14519.           The following messages can be returned by TagItem:
  14520.  
  14521.               TI_OK - the requested action has been performed.
  14522.  
  14523.               TI_EXIT_KEY - a defined exit key has been pressed.
  14524.  
  14525.               TI_MOUSE_EVENT - the mouse has been clicked but it has not
  14526.               been pointed to the area defined by the function.
  14527.  
  14528.               TI_ILLEGAL_KEY - an undefined key has been pressed.
  14529.  
  14530.               TI_MY_MOUSE - the mouse has been clicked after pointing to
  14531.               the area defined by the function. This message is in response
  14532.               to a TI_CHECK_MOUSE message.
  14533.  
  14534.               TI_NEW_POSITION - this message is returned when you highlight
  14535.               an item either with the mouse or the keyboard.
  14536.  
  14537.           Example:
  14538.  
  14539.           #include <scl1.h>
  14540.           #include <scl1clor.h>
  14541.           #include <scl1keys.h>
  14542.  
  14543.           unsigned int MyExitKeys[]={ENTER,ESC,0};
  14544.  
  14545.           TIData ti={WHITE_BLACK,12,28,0,"Create Backup files"};
  14546.  
  14547.           char Text[]="Use the SPACEBAR to toggle option ON/OFF\n"
  14548.                       "  Press ENTER to accept, ESC to cancel";
  14549.  
  14550.           main()
  14551.           {
  14552.           int Mess;
  14553.  
  14554.           Cls(WHITE_BLACK,0,0,24,79);
  14555.  
  14556.                     SCL1 Version 3.1 - Reference Manual - Page 237
  14557.  
  14558.  
  14559.  
  14560.  
  14561.  
  14562.  
  14563.  
  14564.                                                           TagItem - TagList
  14565.  
  14566.           WriteScreen(WHITE_BLACK+HIGHLIGHT,14,20,Text);
  14567.           TagItem(TI_RESET,&ti);
  14568.           ti.ExitKeys=MyExitKeys;
  14569.           TagItem(TI_DRAW,&ti);
  14570.  
  14571.           do
  14572.               {
  14573.               Mess=TagItem(TI_ACTIVE,&ti);
  14574.               }while(Mess != TI_EXIT_KEY);
  14575.  
  14576.           if(ti.EventInfo != ESC)
  14577.               {
  14578.               if(ti.TagFl)
  14579.                   WriteScreen(WHITE_BLACK+BLINK+HIGHLIGHT,18,29,
  14580.                          "You have selected YES");
  14581.               else
  14582.                   WriteScreen(WHITE_BLACK+BLINK+HIGHLIGHT,18,30,
  14583.                          "You have selected NO");
  14584.               }
  14585.           else
  14586.               WriteScreen(WHITE_BLACK+BLINK+HIGHLIGHT,18,29,
  14587.                          "Operation was canceled");
  14588.  
  14589.           SetCurPos(20,0);
  14590.           exit(0);
  14591.           }
  14592.  
  14593.           -----------------------------------------------------------------
  14594.                                        TagList
  14595.           -----------------------------------------------------------------
  14596.  
  14597.           Purpose:    Displays in a ScrollBox any number of items that the
  14598.                       user can tag using the keyboard (spacebar) or the
  14599.                       mouse.
  14600.  
  14601.           Prototype:  int TagList(int NColor, int RColor,
  14602.                             struct TagList *tl);
  14603.  
  14604.           Returns:    Return value is a number above "0" if the user
  14605.                       pressed ENTER to exit, otherwise returns "-1". In
  14606.                       case the user has pressed ESCAPE to exit, the tagged
  14607.                       items are returned in the same way as they were
  14608.                       received.
  14609.  
  14610.           Parameters: The taglist information is given as an array of
  14611.                       structures as follows:
  14612.  
  14613.           struct TagList{
  14614.               char TagFl;      equals "1" if item is tagged.
  14615.  
  14616.  
  14617.                     SCL1 Version 3.1 - Reference Manual - Page 238
  14618.  
  14619.  
  14620.  
  14621.  
  14622.  
  14623.  
  14624.  
  14625.                                                                     TagList
  14626.  
  14627.               char *String;    pointer to the item string.
  14628.               };
  14629.           Note: The TagList structure must be zero terminated.
  14630.  
  14631.           The function is called with the following parameters:
  14632.  
  14633.               NColor - color used for box and items (integer).
  14634.  
  14635.               RColor - color used for selected item (integer).
  14636.  
  14637.               tl - pointer to structure TagList. This structure is defined
  14638.               in SCL1.H.
  14639.  
  14640.           Example:
  14641.  
  14642.           #include <scl1.h>
  14643.           #include <scl1clor.h>
  14644.  
  14645.           struct TagList tl[]={
  14646.               0,"Option 1",
  14647.               0,"Option 2",
  14648.               0,"Option 3",
  14649.               0,"Option 4",
  14650.               0,"Option 5",
  14651.               0,"Option 6",
  14652.               0,"Option 7",
  14653.               0,"Option 8",
  14654.               0,"Option 9",
  14655.               0};
  14656.  
  14657.           main()
  14658.           {
  14659.           int i;
  14660.  
  14661.           if(TagList(WHITE_BLACK,BLACK_WHITE,tl) != -1) 
  14662.                   /*  cancel selected?  */
  14663.               {
  14664.               printf("\nThe following options were tagged:\n");
  14665.               for(i=0;i < 9;++i)
  14666.                   {
  14667.                   if(tl[i].TagFl)
  14668.                       printf("%s\n",tl[i].String);
  14669.                   }
  14670.               }
  14671.           else
  14672.               printf("\nOperation canceled by user\n");
  14673.           }
  14674.  
  14675.           NOTE:   The new dialog type function TagList2 provides an
  14676.                   alternative way to accomplish this task.
  14677.  
  14678.                     SCL1 Version 3.1 - Reference Manual - Page 239
  14679.  
  14680.  
  14681.  
  14682.  
  14683.  
  14684.  
  14685.  
  14686.                                                                    TagList2
  14687.           -----------------------------------------------------------------
  14688.                                        TagList2
  14689.           -----------------------------------------------------------------
  14690.  
  14691.           Purpose:    Displays a list of items and permits tagging and
  14692.                       untagging of selected items. The list will scroll
  14693.                       vertically when the number of items is larger than
  14694.                       the display length using the cursor keys or the
  14695.                       mouse. Pressing the SPACEBAR key or clicking the
  14696.                       mouse in a highlighted item tags the desired item.
  14697.  
  14698.           Prototype:  int Taglist2(int Message,TLData *p,...)
  14699.  
  14700.           Returns:    This is a dialog derived function. See Appendix "E"
  14701.                       for a description of the general operation of these
  14702.                       functions. The return value is a message described in
  14703.                       the Messages section.
  14704.  
  14705.           Parameters: Dialog type functions receive messages and structures
  14706.                       as parameters. The Tag List information must be given
  14707.                       in a structure type TLData as follows:
  14708.  
  14709.           typedef struct{
  14710.               int NColor;         Color for normal display.
  14711.  
  14712.               int RColor;         Color for reversed display).
  14713.  
  14714.               int TColor;         Color for displaying a tagged item.
  14715.  
  14716.               int UpperRow;       Upper row of the window.
  14717.  
  14718.               int LeftCol;        Left column of the window.
  14719.  
  14720.               int LowerRow;       Lower row of the window.
  14721.  
  14722.               int RightCol;       Right column of the window.
  14723.  
  14724.               char **Array;       Pointer to array of pointers to be
  14725.                                   displayed.
  14726.  
  14727.               char *TagArray;     Char pointer to an array that hold the
  14728.                                   tagging information about each item.
  14729.  
  14730.               }TLData;
  14731.  
  14732.           The messages that can be sent to the TagList2 function are:
  14733.  
  14734.               TL_INIT - initialize the TLData structure as follows:
  14735.  
  14736.                   NColor - set to white characters in a black background or
  14737.                   the normal color set by SetDialogColors.
  14738.  
  14739.                     SCL1 Version 3.1 - Reference Manual - Page 240
  14740.  
  14741.  
  14742.  
  14743.  
  14744.  
  14745.  
  14746.  
  14747.                                                                    TagList2
  14748.  
  14749.                   RColor - set to highlighted white characters in a black
  14750.                   background or the normal color set by SetDialogColors.
  14751.  
  14752.                   TColor - set to black characters in a white background or
  14753.                   the reversed color set by SetDialogColors.
  14754.  
  14755.                   UpperRow - set to row "6".
  14756.  
  14757.                   LeftCol - set to column "5" for 40 column display and
  14758.                   "34" for 80 column display.
  14759.  
  14760.                   LowerRow - set to row "17" for 24 row display and "29"
  14761.                   for 43 row display.
  14762.  
  14763.                   RightCol - set to row "34" for 40 column display and "55"
  14764.                   for 80 column display.
  14765.  
  14766.               TL_DRAW -  display the Tag List with the current information.
  14767.  
  14768.               TL_ACTIVE - browse through the displayed items and permit the
  14769.               selection or tagging of them using the keyboard as follows:
  14770.  
  14771.                          Key                  Action
  14772.  
  14773.                       Up Arrow       cursor one item up.
  14774.                       Down Arrow     cursor one item down.
  14775.                       END            cursor to end of file list.
  14776.                       HOME           cursor to beginning of list.
  14777.                       Page Up        cursor one screen up.
  14778.                       Page Down      cursor one screen down.
  14779.                       SpaceBar       Tag or Untag an item
  14780.  
  14781.           The messages that TagList2 can return are:
  14782.  
  14783.               TL_OK - the requested action has been performed.
  14784.  
  14785.               TL_CANCEL - cancel the TagList2 operation.
  14786.  
  14787.           Example:
  14788.  
  14789.           #include <scl1.h>
  14790.  
  14791.               /* Shows the use of the TagList2 function */
  14792.  
  14793.           char *options[]={
  14794.               "Option 1",
  14795.               "Option 2",
  14796.               "Option 3",
  14797.               "Option 4",
  14798.               "Option 5",
  14799.  
  14800.                     SCL1 Version 3.1 - Reference Manual - Page 241
  14801.  
  14802.  
  14803.  
  14804.  
  14805.  
  14806.  
  14807.  
  14808.                                                          TagList2 - TagMenu
  14809.  
  14810.               "Option 6",
  14811.               "Option 7",
  14812.               0};
  14813.  
  14814.           char tarray[7];
  14815.  
  14816.           main()
  14817.           {
  14818.           TLData tl;
  14819.           int i,Mess;
  14820.  
  14821.           TagList2(TL_INIT,&tl);        /* initialize structure */
  14822.           tl.UpperRow=6;                /* modify position */
  14823.           tl.LowerRow=15;
  14824.           tl.LeftCol=20;
  14825.           tl.RightCol=60;
  14826.           tl.Array=options;             /* our data*/
  14827.           tl.TagArray=tarray;           /* tag array */
  14828.           TagList2(TL_DRAW,&tl);        /* draw */
  14829.           InitMouse(IM_SHOW);
  14830.           Mess=TagList2(TL_ACTIVE,&tl); /* active */
  14831.           if(Mess==TL_OK)
  14832.               {
  14833.               printf("\nThe following options were tagged:\n");
  14834.               for(i=0;i < 7;++i)
  14835.                   {
  14836.                   if(tarray[i])
  14837.                   printf("%s\n",options[i]);
  14838.                   }
  14839.               }
  14840.           else
  14841.               printf("\nOperation canceled by user\n");
  14842.           }
  14843.  
  14844.           -----------------------------------------------------------------
  14845.                                        TagMenu
  14846.           -----------------------------------------------------------------
  14847.  
  14848.           Purpose:    Displays a menu from which you can tag options. An
  14849.                       item is toggled on or off by moving the highlighted
  14850.                       bar with the arrow keys and then pressing the
  14851.                       SPACEBAR or by clicking the mouse. The tagged options
  14852.                       will be marked with a check mark. Upon exit you can
  14853.                       either cancel the operation or continue.
  14854.  
  14855.           Prototype:  int TagMenu(char NormalColor, char ReverseColor,
  14856.                          char HighlightColor, char NumOpt,struct MenuOpt*,
  14857.                          int XMin,int XMax,int YMin,int YMax);
  14858.  
  14859.  
  14860.  
  14861.                     SCL1 Version 3.1 - Reference Manual - Page 242
  14862.  
  14863.  
  14864.  
  14865.  
  14866.  
  14867.  
  14868.  
  14869.                                                                     TagMenu
  14870.  
  14871.           Returns:    The returned value is "0" if the user selects the
  14872.                       accept option and "-1" if the operation is canceled. 
  14873.                       The calling program must check the first character of
  14874.                       each selection of the structure to find out if a
  14875.                       selection was tagged.
  14876.  
  14877.           Parameters: The menu information is given as an array of
  14878.                       structures as follows:
  14879.  
  14880.           struct MenuOpt{
  14881.               int Row;         Row position for the menu item.
  14882.  
  14883.               int Col;         Column position for the menu item.
  14884.  
  14885.               char *String;    Pointer to the menu item text.
  14886.  
  14887.               int Letter;      Letter to be highlighted for fast keyboard
  14888.                                selection of the menu item.
  14889.               };
  14890.  
  14891.           Note:   The last two options in the menu structure are the exit
  14892.                   control codes to the function. First the option that
  14893.                   cancels the operation and then the option that accepts
  14894.                   the operation.
  14895.  
  14896.           The parameters passed to the function are:
  14897.  
  14898.               NColor - color of the menu background and foreground
  14899.               (integer).
  14900.  
  14901.               RColor - color of the highlighted item menu bar (integer).
  14902.  
  14903.               HColor - color for the highlighted quick selection menu item
  14904.               letter (integer).
  14905.  
  14906.               NumOpt - number of menu options (integer).
  14907.  
  14908.               MenuOpt - pointer to the menu structure (char).
  14909.  
  14910.               XMin - minimum row position of menu area (integer).
  14911.  
  14912.               XMax - maximum row position of menu area (integer).
  14913.  
  14914.               YMin - minimum column position of menu area (integer).
  14915.  
  14916.               YMax - maximum column position of menu area (integer).
  14917.  
  14918.  
  14919.  
  14920.  
  14921.  
  14922.                     SCL1 Version 3.1 - Reference Manual - Page 243
  14923.  
  14924.  
  14925.  
  14926.  
  14927.  
  14928.  
  14929.  
  14930.                                                                     TagMenu
  14931.  
  14932.           Example:
  14933.  
  14934.           #include <scl1.h>
  14935.           #include <scl1clor.h>
  14936.  
  14937.           struct MenuOpt mo[]={
  14938.               9,35," Option 1 ",'1',
  14939.               10,35," Option 2 ",'2',
  14940.               11,35," Option 3 ",'3',
  14941.               13,35,"  CANCEL  ",'C',
  14942.               14,35,"    OK    ",'O',
  14943.               };
  14944.  
  14945.           main()
  14946.           {
  14947.           int i;
  14948.           Cls(WHITE_BLACK,8,34,15,45);
  14949.           Box(WHITE_BLACK,1,8,34,15,45);
  14950.           if(TagMenu(WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,5,mo,
  14951.                         35,44,8,15) != -1)
  14952.               {
  14953.               printf("The following options were tagged:\n");
  14954.               for(i=0;i < 3;++i)
  14955.                   {
  14956.                   if(mo[i].String[0] != ' ')
  14957.                       printf("Option %i\n",i+1);
  14958.                   }
  14959.               }
  14960.           else
  14961.               printf("CANCEL was selected\n");
  14962.           }
  14963.  
  14964.  
  14965.  
  14966.  
  14967.  
  14968.  
  14969.  
  14970.  
  14971.  
  14972.  
  14973.  
  14974.  
  14975.  
  14976.  
  14977.  
  14978.  
  14979.  
  14980.  
  14981.  
  14982.  
  14983.                     SCL1 Version 3.1 - Reference Manual - Page 244
  14984.  
  14985.  
  14986.  
  14987.  
  14988.  
  14989.  
  14990.  
  14991.                                                                  TextWindow
  14992.           -----------------------------------------------------------------
  14993.                                       TextWindow
  14994.           -----------------------------------------------------------------
  14995.  
  14996.           Purpose:    Displays text in a window.
  14997.  
  14998.           Prototype:  int TextWindow(int Message,TWData *p,...); 
  14999.  
  15000.           Returns:    This is a dialog type function. See Appendix "E" for
  15001.                       a description of the general operation of these
  15002.                       functions. Returns a message described in the
  15003.                       Messages section.
  15004.  
  15005.           Parameters: Dialog type functions receive messages and structures
  15006.                       as parameters. The text window information is given
  15007.                       in a structure type TWData as follows:
  15008.  
  15009.           typedef struct{
  15010.               int Color;          Color for the window display.
  15011.  
  15012.               int UpperRow;       Upper row for the window display.
  15013.  
  15014.               int LeftCol;        Left column for the window display.
  15015.  
  15016.               int LowerRow;       Lower row for the window display.
  15017.  
  15018.               int RightCol;       Right column for the window display.
  15019.  
  15020.               int FrameType;      Frame type as defined in Box.
  15021.  
  15022.               int WrapFlag;       Flag to indicate if the displayed line
  15023.                                   will be truncated or wrapped if the
  15024.                                   line's length exceeds the window's width.
  15025.                                   A value of "0" indicates no wrap and a
  15026.                                   value of "1" indicates wrap.
  15027.  
  15028.               int Position;       Structure element (internal) to determine
  15029.                                   the current position within the window.
  15030.               }TWData;
  15031.  
  15032.           The following messages can be sent to TextWindow:
  15033.  
  15034.  
  15035.  
  15036.  
  15037.  
  15038.  
  15039.  
  15040.  
  15041.  
  15042.  
  15043.  
  15044.                     SCL1 Version 3.1 - Reference Manual - Page 245
  15045.  
  15046.  
  15047.  
  15048.  
  15049.  
  15050.  
  15051.  
  15052.                                                                  TextWindow
  15053.  
  15054.               TW_INIT - initialize the TWData structure to null and sets
  15055.               the following default values.
  15056.  
  15057.                   Color - set to white characters in a black background or
  15058.                   the normal color set by SetDialogColors.
  15059.  
  15060.                   LowerRow - set to maximum screen row size.
  15061.  
  15062.                   RightCol - set to maximum screen column size.
  15063.  
  15064.                   FrameType - set to single line frame.
  15065.  
  15066.               TW_DRAW -  draw the text window to the screen.
  15067.  
  15068.               TW_WRITE - write the text information to the Text Window.
  15069.  
  15070.               TW_CLS - clear the window.
  15071.  
  15072.               TW_LINE_DOWN - move the cursor one line down.
  15073.  
  15074.               TW_DRAW_BORDER - draw border around the Text Window.
  15075.  
  15076.               TW_WAIT_ON - text will be written until the window is full
  15077.               then it stops and waits for a keypress. When a key is pressed
  15078.               the window is cleared.
  15079.  
  15080.               TW_WAIT_OFF - when the window is full it returns a
  15081.               TW_WINDOW_FULL message (default).
  15082.  
  15083.               TW_RESET - when this message is sent the position variables
  15084.               are reset to the default value. If the exit keys have not
  15085.               been defined they are set to the default exit keys.
  15086.  
  15087.           The following messages can be returned by TextWindow:
  15088.  
  15089.               TW_OK - the requested action has been performed successfully.
  15090.  
  15091.               TW_WINDOW_FULL - the Text Window is full.
  15092.  
  15093.           Example:
  15094.  
  15095.           #include <scl1.h>
  15096.           #include <scl1clor.h>
  15097.  
  15098.               /* TextWindow example */
  15099.  
  15100.           char *strings[]={
  15101.               "These strings will be written",
  15102.               "to a Text Window, one by one.",
  15103.               "Text will scroll in TTY mode",
  15104.  
  15105.                     SCL1 Version 3.1 - Reference Manual - Page 246
  15106.  
  15107.  
  15108.  
  15109.  
  15110.  
  15111.  
  15112.  
  15113.                                                                  TextWindow
  15114.  
  15115.               "So as to simulate a",
  15116.               "DOS like screen.",
  15117.               "Several control characters",
  15118.               "like\t\ttab (\\t),",
  15119.               "new line (\\n)\rand carriage return (\\r)",
  15120.               "are supported."};
  15121.  
  15122.           main()
  15123.           {
  15124.           TWData twd;
  15125.           int i,Mess;
  15126.  
  15127.           Cls(WHITE_BLACK,CLS_ALL);
  15128.           TextWindow(TW_INIT,&twd);     /* initialize structure */
  15129.           twd.UpperRow=10;              /* modify position */
  15130.           twd.LowerRow=15;
  15131.           twd.LeftCol=20;
  15132.           twd.RightCol=60;
  15133.  
  15134.               /*  In this example we'll check for the WINDOW_FULL message
  15135.                   and wait for a key to be pressed before writing anything
  15136.                   else */
  15137.  
  15138.           TextWindow(TW_DRAW,&twd);     /* draw */
  15139.           for(i=0;i < 9;++i)
  15140.               {
  15141.               Mess=TextWindow(TW_WRITE,&twd,strings[i]);
  15142.               if(Mess==TW_WINDOW_FULL) /* window full? */
  15143.                   {
  15144.                   WriteScreen(WHITE_BLACK+HIGHLIGHT,16,21,"Press any key
  15145.                           for more...");
  15146.                   GetKey();
  15147.                   TextWindow(TW_CLS,&twd);
  15148.                   }
  15149.               }
  15150.  
  15151.           WaitTime(100);
  15152.  
  15153.               /*  Now, we'll get the same effect using the WAIT_ON message,
  15154.                   TextWindow will now stop and wait for a key when the
  15155.                   window is full */
  15156.  
  15157.           TextWindow(TW_DRAW,&twd);
  15158.           TextWindow(TW_WAIT_ON,&twd);
  15159.           for(i=0;i < 9;++i)
  15160.               TextWindow(TW_WRITE,&twd,strings[i]);
  15161.           }
  15162.  
  15163.  
  15164.  
  15165.  
  15166.                     SCL1 Version 3.1 - Reference Manual - Page 247
  15167.  
  15168.  
  15169.  
  15170.  
  15171.  
  15172.  
  15173.  
  15174.             TL_SetUserLang - TrapBIOSScreenWrite - TrapInt10 - RestoreInt10
  15175.           -----------------------------------------------------------------
  15176.                                     TL_SetUserLang
  15177.           -----------------------------------------------------------------
  15178.  
  15179.           Purpose:    Lets you modify the default prompts of the TagList2
  15180.                       function. With this function you can customize the
  15181.                       default "Ok" and "Cancel" prompts. This is useful
  15182.                       when writing programs in languages other that
  15183.                       English.
  15184.  
  15185.           Prototype:  void TL_SetUserLang(char **prompt,int offset1,
  15186.                          int offset2);
  15187.  
  15188.           Returns:    Nothing.
  15189.  
  15190.           Parameters:
  15191.  
  15192.               prompt - pointer to a null terminated array of char pointers
  15193.               that holds the modified prompts.
  15194.  
  15195.               offset1 - distance from the left margin of the box where the
  15196.               first mouse button ("Ok") will be displayed.
  15197.  
  15198.               offset2 - distance from the left margin of the box where the
  15199.               second mouse button ("CANCEL") will be displayed.
  15200.  
  15201.           Example:    See FB_SetUserLang
  15202.  
  15203.           -----------------------------------------------------------------
  15204.                      TrapBIOSScreenWrite, TrapInt10, RestoreInt10
  15205.           -----------------------------------------------------------------
  15206.  
  15207.           Purpose:    Traps BIOS interrupt 0x10 and prevents BIOS from
  15208.                       writing to the screen. Upon program exit the original
  15209.                       interrupt is restored. You can also call the
  15210.                       TrapInt10 and RestoreInt10 functions to get the same
  15211.                       results.
  15212.  
  15213.           Prototype:  int TrapBIOSScreenWrite(void);
  15214.                       void TrapInt10(void);
  15215.                       void RestoreInt10(void);
  15216.  
  15217.           Returns:    TrapBIOSScreenWrite returns "-1" if an error is
  15218.                       encountered.
  15219.  
  15220.           Parameters: None
  15221.  
  15222.  
  15223.  
  15224.  
  15225.  
  15226.  
  15227.                     SCL1 Version 3.1 - Reference Manual - Page 248
  15228.  
  15229.  
  15230.  
  15231.  
  15232.  
  15233.  
  15234.  
  15235.                  TrapBIOSScreenWrite - TrapInt10 - RestoreInt10 - TrapInt23
  15236.  
  15237.           Example:
  15238.  
  15239.           one step procedure:
  15240.  
  15241.               TrapBIOSScreenWrite(); /* BIOS and DOS screen write trapped*/
  15242.  
  15243.               /* int 0x10 will be restored automatically on exit */
  15244.  
  15245.           or two step procedure:
  15246.  
  15247.               TrapInt10();        /* trap int 0x10 */
  15248.               .
  15249.               .
  15250.               .
  15251.               .
  15252.               RestoreInt10();     /* restore it */
  15253.  
  15254.  
  15255.           -----------------------------------------------------------------
  15256.                                       TrapInt23
  15257.           -----------------------------------------------------------------
  15258.  
  15259.           Purpose:    Traps every occurrence of the Control+Break key
  15260.                       combination. Global variable I23_CtrlBreakFl is
  15261.                       incremented every time this key combination is
  15262.                       pressed.
  15263.  
  15264.           Prototype:  void TrapInt23(void);
  15265.  
  15266.           Returns:    Nothing
  15267.  
  15268.           Parameters: None
  15269.  
  15270.           Example:
  15271.  
  15272.           #include <scl1.h>
  15273.  
  15274.           main()
  15275.           {
  15276.           TrapInt23();
  15277.           printf("Press Ctrl/Break to exit\n");
  15278.           do
  15279.               {
  15280.               }while(I23_CtrlBreakFl==0);
  15281.           }
  15282.  
  15283.  
  15284.  
  15285.  
  15286.  
  15287.  
  15288.                     SCL1 Version 3.1 - Reference Manual - Page 249
  15289.  
  15290.  
  15291.  
  15292.  
  15293.  
  15294.  
  15295.  
  15296.                                                                   TrapInt24
  15297.           -----------------------------------------------------------------
  15298.                                       TrapInt24
  15299.           -----------------------------------------------------------------
  15300.  
  15301.           Purpose:    Critical error interrupt handler. Displays an error
  15302.                       box showing the critical error that has occurred.
  15303.                       Asks the user if he wants to retry or not the
  15304.                       operation.
  15305.  
  15306.                       This function is useful to avoid the familiar DOS
  15307.                       message "Abort, Retry, Ignore?" from appearing on
  15308.                       your screen.  Also it gives you extra control when
  15309.                       you are performing a series of file operations. If a
  15310.                       file function returns "-1" it means that the user
  15311.                       does not want to retry the operation, in this case
  15312.                       the program can a stop the other I/O operations it
  15313.                       was going to perform.
  15314.  
  15315.                       This function only traps critical errors like: disk
  15316.                       drive door opened, printer off-line, trying to read
  15317.                       an unformatted disk, etc.
  15318.  
  15319.                       To initialize TrapInt24 call it at the beginning of
  15320.                       your program. It should be called ONLY ONCE. To alter
  15321.                       the error box appearance use SetInt24Colors,
  15322.                       Int24ShadowOff and Int24ShadowOn. The function saves
  15323.                       and restore the screen area where the error box is
  15324.                       displayed. To initialize TrapInt24 call it at the
  15325.                       beginning of your program.
  15326.  
  15327.           Prototype:  void TrapInt24(void);
  15328.  
  15329.           Returns:    Nothing
  15330.  
  15331.           Parameters: None
  15332.  
  15333.  
  15334.  
  15335.  
  15336.  
  15337.  
  15338.  
  15339.  
  15340.  
  15341.  
  15342.  
  15343.  
  15344.  
  15345.  
  15346.  
  15347.  
  15348.  
  15349.                     SCL1 Version 3.1 - Reference Manual - Page 250
  15350.  
  15351.  
  15352.  
  15353.  
  15354.  
  15355.  
  15356.  
  15357.                                                              Tsound - Video
  15358.           -----------------------------------------------------------------
  15359.                                         TSound
  15360.           -----------------------------------------------------------------
  15361.  
  15362.           Purpose:    Plays a sound of the specified frequency and for a
  15363.                       specified length of time (in hundredths of a second).
  15364.  
  15365.           Prototype:  void TSound(int Frequency, unsigned int Duration);
  15366.  
  15367.           Returns:    Nothing
  15368.  
  15369.           Parameters:
  15370.  
  15371.               Frequency - the note frequency in Hertz (integer).
  15372.  
  15373.               Duration - length of the note in hundredths of a second
  15374.               (unsigned integer).
  15375.  
  15376.           Example:
  15377.  
  15378.           TSound(1000,100);/*play a 1000 Hertz tone for one second.*/
  15379.  
  15380.           See the note definitions in header file SCL1SND.H.
  15381.  
  15382.           -----------------------------------------------------------------
  15383.                                         Video
  15384.           -----------------------------------------------------------------
  15385.  
  15386.           Purpose:    Detects if the video adapter in use is either
  15387.                       Monochrome or Color. Declares and defines the
  15388.                       variable VC_Segment (unsigned int) that holds Video
  15389.                       Buffer segment address. (The VideoConfig function
  15390.                       provides additional information)
  15391.  
  15392.           Prototype:  unsigned int Video(void);
  15393.  
  15394.           Returns:    The return value is defined in SCL1.H as MONO for
  15395.                       monochrome monitors, or COLOR if a color monitors.
  15396.  
  15397.           Parameters: None
  15398.  
  15399.           Example:
  15400.  
  15401.           #include <scl1.h>
  15402.           main()
  15403.           {
  15404.           if(Video()==MONO)
  15405.               printf("You have a monochrome monitor\n");
  15406.           else
  15407.               printf("You have a color monitor\n");
  15408.           }
  15409.  
  15410.                     SCL1 Version 3.1 - Reference Manual - Page 251
  15411.  
  15412.  
  15413.  
  15414.  
  15415.  
  15416.  
  15417.  
  15418.                                                                 VideoConfig
  15419.           -----------------------------------------------------------------
  15420.                                      VideoConfig
  15421.           -----------------------------------------------------------------
  15422.  
  15423.           Purpose:    Fills a structure with the current video information
  15424.                       for use by other functions. It will be called by the
  15425.                       first function that uses direct video write. Also
  15426.                       sets global variables VC_Monitor, VC_Mode, VC_Page,
  15427.                       VC_Lines, VC_Cols, VC_Retrace and VC_Segment with the
  15428.                       current video information.
  15429.  
  15430.           Prototype:  struct VideoData *VideoConfig(void);
  15431.  
  15432.           Returns:    a pointer to the VideoData structure.
  15433.  
  15434.           Parameters: The video information is stored in a structure type
  15435.                       VideoData as follows:
  15436.  
  15437.           struct VideoData{
  15438.               int Monitor;           Type of monitor detected. The
  15439.                                      following types have been defined in
  15440.                                      SCL1.H:
  15441.  
  15442.                                      VC_MDA - Monochrome
  15443.                                      VC_CGA - CGA monitor
  15444.                                      VC_EGA - EGA monitor
  15445.                                      VC_EGAM - EGA with monochrome monitor
  15446.                                      VC_PGC - Professional graphic
  15447.                                      VC_VGAM - VGA / monochrome
  15448.                                      VC_VGA - VGA
  15449.                                      VC_MCGADC - MCGA Digital
  15450.                                      VC_MCGAAM - MCGA Analog/mono
  15451.                                      VC_MCGAAC - MCGA Analog/color
  15452.  
  15453.               int Mode;              Active video mode.
  15454.  
  15455.               int Page;              Active video page.
  15456.  
  15457.               int Lines;             Number of rows in active video mode.
  15458.  
  15459.               int Cols;              Number of columns in active video
  15460.                                      mode.
  15461.  
  15462.               unsigned int Segment;  Segment used by current video mode.
  15463.  
  15464.  
  15465.  
  15466.  
  15467.  
  15468.  
  15469.  
  15470.  
  15471.                     SCL1 Version 3.1 - Reference Manual - Page 252
  15472.  
  15473.  
  15474.  
  15475.  
  15476.  
  15477.  
  15478.  
  15479.                                                                 VideoConfig
  15480.  
  15481.               int Retrace;           Structure element that tells the
  15482.                                      functions to use or not to use
  15483.                                      retrace. With a "0" value the direct
  15484.                                      screen writes will use no retrace,
  15485.                                      with a "1" value will use retrace. By
  15486.                                      default this value will be set to "0"
  15487.                                      for all video systems except VC_CGA.
  15488.               };
  15489.  
  15490.           Example:
  15491.  
  15492.           #include <scl1.h>
  15493.  
  15494.           char *vs[]={
  15495.               "",
  15496.               "Monochrome",
  15497.               "CGA",
  15498.               "",
  15499.               "EGA",
  15500.               "EGA - mono",
  15501.               "PGC",
  15502.               "VGA - mono",
  15503.               "VGA",
  15504.               "",
  15505.               "MCGA - digital - color",
  15506.               "MCGA - analog - mono",
  15507.               "MCGA - analog - color",
  15508.               };
  15509.  
  15510.           main()
  15511.           {
  15512.           struct VideoData *vd;
  15513.  
  15514.           vd=VideoConfig();
  15515.           printf("\n  Video system: %s\n",vs[vd->Monitor]);
  15516.           printf("    Video mode: %i\n",vd->Mode);
  15517.           printf("   Active page: %i\n",vd->Page);
  15518.           printf("         Lines: %i\n",vd->Lines);
  15519.           printf("       Columns: %i\n",vd->Cols);
  15520.           printf("Buffer segment: %X\n\n",vd->Segment);
  15521.           }
  15522.           See also Video.
  15523.  
  15524.  
  15525.  
  15526.  
  15527.  
  15528.  
  15529.  
  15530.  
  15531.  
  15532.                     SCL1 Version 3.1 - Reference Manual - Page 253
  15533.  
  15534.  
  15535.  
  15536.  
  15537.  
  15538.  
  15539.  
  15540.                                            WaitKeyMouse - WaitTime - Window
  15541.           -----------------------------------------------------------------
  15542.                                      WaitKeyMouse
  15543.           -----------------------------------------------------------------
  15544.  
  15545.           Purpose:    Waits for a keystroke or pressing of the left mouse
  15546.                       button. The function clears the keyboard buffer on
  15547.                       entry.
  15548.  
  15549.           Prototype:  unsigned int WaitKeyMouse(void);
  15550.  
  15551.           Returns:    the key's Scan/Ascii code if a key is pressed.
  15552.  
  15553.           Parameters: None
  15554.  
  15555.           Example:    See HideMouse
  15556.  
  15557.  
  15558.           -----------------------------------------------------------------
  15559.                                        WaitTime
  15560.           -----------------------------------------------------------------
  15561.  
  15562.           Purpose:    Sets a delay of X hundredths of a second.
  15563.  
  15564.           Prototype:  void WaitTime(unsigned int HSec);
  15565.  
  15566.           Returns:    Nothing
  15567.  
  15568.           Parameter:  HSec - time interval in hundredths of a second.
  15569.  
  15570.  
  15571.           -----------------------------------------------------------------
  15572.                                         Window
  15573.           -----------------------------------------------------------------
  15574.  
  15575.           Purpose:    Saves, clears and restores a window.
  15576.  
  15577.           Prototype:  void Window(int Color,int UpperRow,int LeftCol,
  15578.                          int LowerRow,int RightCol,char* Flag,
  15579.                          char* Buffer);
  15580.  
  15581.           Returns:    Nothing
  15582.  
  15583.           Parameters:
  15584.  
  15585.               Color - color for the area to be cleared (integer).
  15586.  
  15587.               UpperRow - upper left row position of the area (integer).
  15588.  
  15589.               LeftCol - upper left column position of the area (integer).
  15590.  
  15591.               LowerRow - lower right row position of the area (integer).
  15592.  
  15593.                     SCL1 Version 3.1 - Reference Manual - Page 254
  15594.  
  15595.  
  15596.  
  15597.  
  15598.  
  15599.  
  15600.  
  15601.                                                                      Window
  15602.  
  15603.               RightCol - lower right column position of the area (integer).
  15604.  
  15605.               Flag - pointer to a variable that holds the action to be
  15606.               performed:
  15607.  
  15608.                       0  -> save and clear area.
  15609.                       -2 -> save area only.
  15610.                       1  -> restore area (saved and cleared).
  15611.                       -1 -> restore area (saved only).
  15612.  
  15613.               Buffer - pointer to a buffer to hold the screen information.
  15614.  
  15615.           Notes:
  15616.  
  15617.               1.  Flag is toggled automatically every time the function is
  15618.                   called.
  15619.  
  15620.               2.  The buffer size is the number of characters * 2. This
  15621.                   size can be calculated by using the W_BUF_SIZE macro
  15622.                   defined in SCL1.H.
  15623.  
  15624.           Example:
  15625.  
  15626.           #include <scl1.h>
  15627.           #include <scl1keys.h>
  15628.           #include <scl1clor.h>
  15629.  
  15630.           /*  screen data is stored in these buffers, use W_BUF_SIZE macro
  15631.               to calculate buffer size */
  15632.  
  15633.           char buffer1[W_BUF_SIZE(0,0,24,79)];
  15634.           char buffer2[W_BUF_SIZE(9,26,15,52)];
  15635.  
  15636.           main()
  15637.           {
  15638.           char WFlag1=-2;     /* save do not clear screen */
  15639.           char WFlag2=0;      /* save and clear screen */
  15640.  
  15641.           Window(BLACK_WHITE,0,0,24,79,&WFlag1,buffer1);
  15642.  
  15643.           FillBlock(WHITE_BLACK,0,0,24,79,'X');
  15644.  
  15645.           WriteScreenLen(BLACK_WHITE,24,0,70," The whole screen has
  15646.                             been saved, press any key...");
  15647.           GetKey();
  15648.  
  15649.           Window(WHITE_BLACK,9,26,15,52,&WFlag2,buffer2);
  15650.  
  15651.           WriteScreenLen(BLACK_WHITE,24,0,70," A second window was SAVED
  15652.                             AND CLEARED, press any key to restore it...");
  15653.  
  15654.                     SCL1 Version 3.1 - Reference Manual - Page 255
  15655.  
  15656.  
  15657.  
  15658.  
  15659.  
  15660.  
  15661.  
  15662.                                                          Window - WriteChar
  15663.  
  15664.           GetKey();
  15665.  
  15666.           Window(WHITE_BLACK,9,26,15,52,&WFlag2,buffer2);
  15667.  
  15668.           WriteScreenLen(BLACK_WHITE,24,0,70," Press any key to restore
  15669.                            the screen...");
  15670.           GetKey();
  15671.           Window(BLACK_WHITE,0,0,24,79,&WFlag1,buffer1);
  15672.           }
  15673.  
  15674.           -----------------------------------------------------------------
  15675.                                       WriteChar
  15676.           -----------------------------------------------------------------
  15677.  
  15678.           Purpose:    Writes a character directly to the screen buffer a
  15679.                       specified number of times.
  15680.  
  15681.           Prototype:  void WriteChar(int Color,int Row,int Col,int Count,
  15682.                          int Character);
  15683.  
  15684.           Returns:    Nothing
  15685.  
  15686.           Parameters:
  15687.  
  15688.               Color - color for the character to be displayed (integer).
  15689.  
  15690.               Row - row position to start display (integer).
  15691.  
  15692.               Col - column position to start display (integer).
  15693.  
  15694.               Count - number of times the character is written (integer).
  15695.  
  15696.               Character - the character to be displayed (integer).
  15697.  
  15698.           Example:
  15699.  
  15700.           Writes 80 dashes to the screen from line 10, column 0, using
  15701.           black characters in a white background.
  15702.  
  15703.           WriteChar(0x70,10,0,80,'-');
  15704.  
  15705.  
  15706.  
  15707.  
  15708.  
  15709.  
  15710.  
  15711.  
  15712.  
  15713.  
  15714.  
  15715.                     SCL1 Version 3.1 - Reference Manual - Page 256
  15716.  
  15717.  
  15718.  
  15719.  
  15720.  
  15721.  
  15722.  
  15723.                                                     WriteFile - WriteOffLen
  15724.           -----------------------------------------------------------------
  15725.                                       WriteFile
  15726.           -----------------------------------------------------------------
  15727.  
  15728.           Purpose:    Writes to a file. The function can also be used to
  15729.                       write to the standard printer, console or any other
  15730.                       device if the proper handle number is specified.
  15731.  
  15732.           Prototype:  int WriteFile(int Handle,char *Buffer,
  15733.                             unsigned int Bytes);
  15734.  
  15735.           Returns:    The DOS error code or "0" if no error occurs.  (See
  15736.                       Appendix "A", FILE FUNCTIONS, for more information).
  15737.  
  15738.           Parameters:
  15739.  
  15740.               Handle - handle given by DOS when you open or create a file.
  15741.  
  15742.               Buffer - pointer to the buffer that will hold the data.
  15743.  
  15744.               Bytes - number of bytes to write (unsigned integer).
  15745.  
  15746.           Example:    See CloseFile
  15747.  
  15748.           -----------------------------------------------------------------
  15749.                                      WriteOffLen
  15750.           -----------------------------------------------------------------
  15751.  
  15752.           Purpose:    Writes a string directly to the video buffer. The
  15753.                       display position is specified as an offset from the
  15754.                       home position.  The length to display is specified.
  15755.                       If the string is shorter than the specified length,
  15756.                       the remaining spaces are filled with spaces.
  15757.  
  15758.           Prototype:  void WriteOffLen(int Color,int Offset,int Count,
  15759.                          char * String);
  15760.  
  15761.           Returns:    Nothing
  15762.  
  15763.           Parameters:
  15764.  
  15765.               Color - color of the desired display (integer).
  15766.  
  15767.               Offset - offset from the home position where to display the
  15768.               string.  The offset is calculated as follows: number of
  15769.               columns multiplied by "2" multiplied by the number of rows
  15770.               plus the desired column position multiplied by "2" (integer).
  15771.  
  15772.               Count - length to display (integer).
  15773.  
  15774.               String - pointer to the string to be displayed.
  15775.  
  15776.                     SCL1 Version 3.1 - Reference Manual - Page 257
  15777.  
  15778.  
  15779.  
  15780.  
  15781.  
  15782.  
  15783.  
  15784.                                                   WriteOffLen - WriteOffset
  15785.  
  15786.           Example:
  15787.  
  15788.           Display a 15 character string in position offset 1500, using
  15789.           white characters in a black background.
  15790.  
  15791.           WriteOffLen(0x7,1500,15,"This is a test. ");
  15792.  
  15793.           -----------------------------------------------------------------
  15794.                                      WriteOffset
  15795.           -----------------------------------------------------------------
  15796.  
  15797.           Purpose:    Writes a character directly to the video buffer. The
  15798.                       display position is specified as an offset from the
  15799.                       home position.
  15800.  
  15801.           Prototype:  void WriteOffset(int Color,int Offset,int Character);
  15802.  
  15803.           Returns:    Nothing
  15804.  
  15805.           Parameters:
  15806.  
  15807.               Color - color of the desired display (integer).
  15808.  
  15809.               Offset - offset from the home position where to display the
  15810.               string.  The offset is calculated as follows: number of
  15811.               columns multiplied by "2" multiplied by the number of rows
  15812.               plus the desired column position multiplied by "2" (integer).
  15813.  
  15814.               Character - character to be displayed (integer).
  15815.  
  15816.           Example:
  15817.  
  15818.           #include <scl1.h>
  15819.           #include <scl1clor.h>
  15820.           #define ROW  10
  15821.           #define COL  60
  15822.  
  15823.           char string[]="IN GIRUM IMUS NOCTE ET CONSUMIMUR IGNI";
  15824.  
  15825.           main()
  15826.           {
  15827.           int offset,i;
  15828.  
  15829.           InitVideo();
  15830.           WriteScreen(BLACK_WHITE,ROW-1,23,string);
  15831.           offset = ROW * VC_Cols * 2 + COL  * 2;
  15832.           for(i=0;i < sizeof(string)-1;++i,offset-=2)
  15833.               WriteOffset(BLACK_WHITE,offset,string[i]);
  15834.           }
  15835.  
  15836.  
  15837.                     SCL1 Version 3.1 - Reference Manual - Page 258
  15838.  
  15839.  
  15840.  
  15841.  
  15842.  
  15843.  
  15844.  
  15845.                                   WriteScreen - WriteScreenC - WriteScreenR
  15846.           -----------------------------------------------------------------
  15847.                        WriteScreen, WriteScreenC, WriteScreenR
  15848.           -----------------------------------------------------------------
  15849.  
  15850.           Purpose:    Writes a string directly to the video buffer.
  15851.                       WriteScreen left justifies, WriteScreenC centers and
  15852.                       WriteScreenR right justifies the string. Supports
  15853.                       control character "\n".
  15854.  
  15855.           Prototype:  void WriteScreen(int Color,int Row,int Col,
  15856.                          char *String);
  15857.  
  15858.                       void WriteScreenC(int Color,int Row,int Col,
  15859.                          char *String);
  15860.  
  15861.                       void WriteScreenR(int Color,int Row,int Col,
  15862.                          char *String);
  15863.  
  15864.           Returns:    Nothing
  15865.  
  15866.           Parameters:
  15867.  
  15868.               Color - color of the desired display (integer).
  15869.  
  15870.               Row - row position where to display the string (integer).
  15871.  
  15872.               Col - column position where to display the string (integer).
  15873.  
  15874.               String - pointer to the string to be displayed.
  15875.  
  15876.           Example:
  15877.  
  15878.           #include <scl1.h>
  15879.           #include <scl1clor.h>
  15880.  
  15881.           char Mess[]="SCL1's screen related functions will let you:\n\n"
  15882.                       "   Θ Write directly to the screen.\n\n"
  15883.                       "   Θ Draw boxes.\n\n"
  15884.                       "   Θ Clear or scroll any area of your screen.\n\n"
  15885.                       "   Θ Save and restore any screen area.\n\n"
  15886.                       "   Θ Control cursor size and many more...";
  15887.           main()
  15888.           {
  15889.           /* Displays the string Mess left justified in row 4, column 20 */
  15890.  
  15891.           WriteScreen(WHITE_BLACK,4,20,Mess);
  15892.  
  15893.           GetKey();
  15894.  
  15895.  
  15896.  
  15897.  
  15898.                     SCL1 Version 3.1 - Reference Manual - Page 259
  15899.  
  15900.  
  15901.  
  15902.  
  15903.  
  15904.  
  15905.  
  15906.                 WriteScreen - WriteScreenC - WriteScreenR - WriteScreenCLen
  15907.                                            WriteScreenLen - WriteScreenRLen
  15908.  
  15909.           /* Displays the string Mess right justified in row 4, column 20*/
  15910.  
  15911.           WriteScreenR(WHITE_BLACK,4,20,Mess);
  15912.  
  15913.           GetKey();
  15914.  
  15915.           /* Displays the string Mess centered around row 10, column 40 */
  15916.  
  15917.           WriteScreenC(WHITE_BLACK,10,40,Mess);
  15918.           }
  15919.  
  15920.           -----------------------------------------------------------------
  15921.                    WriteScreenCLen, WriteScreenLen, WriteScreenRLen
  15922.           -----------------------------------------------------------------
  15923.  
  15924.           Purpose:    Writes a string to the video buffer. The length to
  15925.                       display is specified. WriteScreenCLen will center,
  15926.                       WriteScreenLen will left justify and WriteScreenRLen
  15927.                       will right justify the text. If the string is shorter
  15928.                       than the specified length, the remaining spaces are
  15929.                       filled with spaces.
  15930.  
  15931.           Prototype:  void WriteScreenCLen(int Color,int Row,int Col,
  15932.                          int Count,char *String);
  15933.  
  15934.                       void WriteScreenLen(int Color,int Row,int Col,
  15935.                          int Count,char *String);
  15936.  
  15937.                       void WriteScreenRLen(int Color,int Row,int Col,
  15938.                          int Count,char *String);
  15939.  
  15940.           Returns:    Nothing
  15941.  
  15942.           Parameters:
  15943.  
  15944.               Color - color of the desired display (integer).
  15945.  
  15946.               Row - row position where to display the string (integer).
  15947.  
  15948.               Col - column position where to display the string (integer).
  15949.  
  15950.               Count - length to display (integer).
  15951.  
  15952.               String - pointer to the string to be displayed.
  15953.  
  15954.  
  15955.  
  15956.  
  15957.  
  15958.  
  15959.                     SCL1 Version 3.1 - Reference Manual - Page 260
  15960.  
  15961.  
  15962.  
  15963.  
  15964.  
  15965.  
  15966.  
  15967.                          WriteScreenCLen - WriteScreenLen - WriteScreenRLen
  15968.  
  15969.           Example:
  15970.  
  15971.           #include <scl1.h>
  15972.           #include <scl1clor.h>
  15973.  
  15974.           char string1[]="Only the characters that fit inside the box will
  15975.                           written to the screen.";
  15976.  
  15977.           char string2[]="WriteScreenLen blanks the screen if the string\n
  15978.                           is shorter than the length specified:";
  15979.  
  15980.           char *strings[]={"1234567890","12345678","12345"};
  15981.  
  15982.           main()
  15983.           {
  15984.           int TopRow,LeftCol,BottomRow,wide,i;
  15985.           for(TopRow=LeftCol=4,BottomRow=TopRow+2,wide=72;wide > 4;
  15986.               wide-=2,++LeftCol)
  15987.               {
  15988.               Box(BLACK_WHITE,0,TopRow,LeftCol,BottomRow,LeftCol+wide); 
  15989.  
  15990.           WriteScreenLen(BLACK_WHITE,TopRow+1,LeftCol+1,wide-1,string1);
  15991.               GetKey();
  15992.               }
  15993.           Cls(BLACK_WHITE,10,10,14,70);
  15994.           WriteScreen(BLACK_WHITE,11,17,string2);
  15995.           for(i=0;i < 3;++i)
  15996.               {
  15997.               WriteScreenLen(BLACK_WHITE,13,35,34,strings[i]);
  15998.               GetKey();
  15999.               }
  16000.           }
  16001.  
  16002.  
  16003.  
  16004.  
  16005.  
  16006.  
  16007.  
  16008.  
  16009.  
  16010.  
  16011.  
  16012.  
  16013.  
  16014.  
  16015.  
  16016.  
  16017.  
  16018.  
  16019.  
  16020.                     SCL1 Version 3.1 - Reference Manual - Page 261
  16021.  
  16022.  
  16023.  
  16024.  
  16025.  
  16026.  
  16027.  
  16028.                                                                 WriteWindow
  16029.           -----------------------------------------------------------------
  16030.                                      WriteWindow
  16031.           -----------------------------------------------------------------
  16032.  
  16033.           Purpose:    Writes a string to a previously created window. The
  16034.                       string length to display is specified. If the string
  16035.                       is shorter than the specified length, the remaining
  16036.                       spaces are filled with spaces. You can specify the
  16037.                       justification method.  Before using this function
  16038.                       make sure the WData structure has been initialized
  16039.                       and the window created.
  16040.  
  16041.           Prototype:  void WriteWindow(WData *wd,int Row,int Col,
  16042.                          int Count,int Justification,char *String);
  16043.  
  16044.           Returns:    Nothing
  16045.  
  16046.           Parameters:
  16047.  
  16048.               WData - the address of the WData structure.
  16049.  
  16050.               Row - row position, relative to the defined window, to start
  16051.               the string display (integer). This upper left corner of the
  16052.               window has 0,0 coordinates.
  16053.  
  16054.               Col - column position, relative to the defined window, to
  16055.               start the string display (integer).
  16056.  
  16057.               Count - string length to display (integer).  If the specified
  16058.               screen length is larger than the string's length the rest of
  16059.               the line will be cleared.
  16060.  
  16061.               Justification - defines the way the text will be written to
  16062.               the window.  The following justification options have been
  16063.               defined in SCL1.H:
  16064.  
  16065.                   W_LEFT -     text will be left justified.
  16066.  
  16067.                   W_RIGHT -    text will be right justified.
  16068.  
  16069.                   W_CENTER -   text will be centered around specified
  16070.                                coordinates, and NOT around window.  If you
  16071.                                want to specify the window's center you can
  16072.                                use the WData's HorCenter element.
  16073.  
  16074.               String - pointer to the string to be displayed.
  16075.  
  16076.           Example:    See InitWData
  16077.  
  16078.  
  16079.  
  16080.  
  16081.                     SCL1 Version 3.1 - Reference Manual - Page 262
  16082.  
  16083.  
  16084.  
  16085.  
  16086.  
  16087.  
  16088.  
  16089.                                                           XMS_AllocExtended
  16090.           -----------------------------------------------------------------
  16091.                                   XMS_AllocExtended
  16092.           -----------------------------------------------------------------
  16093.  
  16094.           Purpose:    Attempts to allocate a block of the given size out of
  16095.                       the pool of free extended memory. If a block is
  16096.                       available, it is reserved for the caller and a handle
  16097.                       to that block is returned to be used in all
  16098.                       subsequent extended memory calls.
  16099.  
  16100.           Prototype:  int XMS_AllocExtended(int *handle,
  16101.                          unsigned int kbytes);
  16102.  
  16103.           Returns:    Returns one of the following messages defined in
  16104.                       header file SCL1XMS.H:
  16105.  
  16106.                       XMS_OK if the block is allocated.
  16107.  
  16108.                       XMS_NOT_IMPLEMENTED if the function is not
  16109.                       implemented.
  16110.  
  16111.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  16112.  
  16113.                       XMS_ALL_EXTENDED_ALLOCATED if all extended memory is
  16114.                       allocated.
  16115.  
  16116.                       XMS_NO_MORE_HANDLES if all available extended memory
  16117.                       handles are in use.
  16118.  
  16119.           Parameters:
  16120.  
  16121.               handle - pointer to an unsigned integer value that will hold
  16122.               a 16-bit handle to the allocated block.
  16123.  
  16124.               kbytes - pointer to an unsigned integer value that holds the
  16125.               amount of extended memory being requested in K-bytes.
  16126.  
  16127.           Example:    See XMS_Init
  16128.  
  16129.  
  16130.  
  16131.  
  16132.  
  16133.  
  16134.  
  16135.  
  16136.  
  16137.  
  16138.  
  16139.  
  16140.  
  16141.  
  16142.                     SCL1 Version 3.1 - Reference Manual - Page 263
  16143.  
  16144.  
  16145.  
  16146.  
  16147.  
  16148.  
  16149.  
  16150.                                                            XMS_FreeExtended
  16151.           -----------------------------------------------------------------
  16152.                                    XMS_FreeExtended
  16153.           -----------------------------------------------------------------
  16154.  
  16155.           Purpose:    Frees a block of extended memory which was previously
  16156.                       allocated using the XMS_AllocExtended function.
  16157.                       Programs which allocate extended memory should free
  16158.                       their memory blocks before exiting.
  16159.  
  16160.           Prototype:  int XMS_FreeExtended(int handle);
  16161.  
  16162.           Returns:    Returns one of the following messages defined in
  16163.                       header file SCL1XMS.H:
  16164.  
  16165.                       XMS_OK if the block is successfully freed.
  16166.  
  16167.                       XMS_NOT_IMPLEMENTED if the function is not
  16168.                       implemented.
  16169.  
  16170.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  16171.  
  16172.                       XMS_INVALID_HANDLE if the handle is invalid.
  16173.  
  16174.                       XMS_BLOCK_LOCKED if the handle is locked.
  16175.  
  16176.           Parameter:  handle - unsigned integer value that holds a 16-bit
  16177.                       handle to the allocated block.
  16178.  
  16179.           Example:    See XMS_Init
  16180.  
  16181.  
  16182.  
  16183.  
  16184.  
  16185.  
  16186.  
  16187.  
  16188.  
  16189.  
  16190.  
  16191.  
  16192.  
  16193.  
  16194.  
  16195.  
  16196.  
  16197.  
  16198.  
  16199.  
  16200.  
  16201.  
  16202.  
  16203.                     SCL1 Version 3.1 - Reference Manual - Page 264
  16204.  
  16205.  
  16206.  
  16207.  
  16208.  
  16209.  
  16210.  
  16211.                                                        XMS_GetEMBHandleInfo
  16212.           -----------------------------------------------------------------
  16213.                                  XMS_GetEMBHandleInfo
  16214.           -----------------------------------------------------------------
  16215.  
  16216.           Purpose:    Returns additional information about an extended
  16217.                       memory block. Use XMS_LockExtended to get the block's
  16218.                       base address.
  16219.  
  16220.           Prototype:  int XMS_GetEMBHandleInfo(int handle,int *LockCount,
  16221.                          int *FreeHandles,int *BlockSize);
  16222.  
  16223.           Returns:    Returns one of the following messages defined in
  16224.                       header file SCL1XMS.H:
  16225.  
  16226.                       XMS_OK if the block's information is found.
  16227.  
  16228.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  16229.  
  16230.                       XMS_NOT_IMPLEMENTED if the function is not
  16231.                       implemented.
  16232.  
  16233.                       XMS_INVALID_HANDLE if the handle is invalid.
  16234.  
  16235.           Parameters:
  16236.  
  16237.               handle - unsigned integer value that holds a handle to the
  16238.               extended memory block.
  16239.  
  16240.               LockCount - pointer to an integer value that will hold the
  16241.               block's lock count.
  16242.  
  16243.               FreeHandles - pointer to an integer value that will hold the
  16244.               number of free EMB handles in the system.
  16245.  
  16246.               BlockSize - pointer to an integer value that will hold the
  16247.               block's length in K-bytes.
  16248.  
  16249.           Example:    See XMS_Init
  16250.  
  16251.  
  16252.  
  16253.  
  16254.  
  16255.  
  16256.  
  16257.  
  16258.  
  16259.  
  16260.  
  16261.  
  16262.  
  16263.  
  16264.                     SCL1 Version 3.1 - Reference Manual - Page 265
  16265.  
  16266.  
  16267.  
  16268.  
  16269.  
  16270.  
  16271.  
  16272.                                                              XMS_GetVersion
  16273.           -----------------------------------------------------------------
  16274.                                     XMS_GetVersion
  16275.           -----------------------------------------------------------------
  16276.  
  16277.           Purpose:    Lets you obtain the version of the Extended Memory
  16278.                       Manager (driver) installed in your system.
  16279.  
  16280.           Prototype:  int XMS_GetVersion(unsigned int *version);
  16281.  
  16282.           Returns:    Returns one of the following messages defined in
  16283.                       header file SCL1XMS.H:
  16284.  
  16285.                       XMS_OK if XMS has been initialized.
  16286.  
  16287.           Parameter:  version - pointer to an unsigned integer value that
  16288.                       contains the XMS driver's version number. To
  16289.                       determine the version number you can decode the
  16290.                       returned value as follows:
  16291.  
  16292.               Two macros XMS_MAJOR_VER(i) and XMS_MINOR_VER(i) have been
  16293.               defined int SCL1XMS.H. These macros extract the XMS version
  16294.               number from the variable version.
  16295.  
  16296.               To get the most significant part (MAJOR) of the version
  16297.               number use the following relation:
  16298.  
  16299.               Major=XMS_MAJOR_VER(i);
  16300.  
  16301.               The get the least significant part (MINOR) of the version
  16302.               number use the following relation:
  16303.  
  16304.               Minor=XMS_MINOR_VER(i);
  16305.  
  16306.               The XMS driver version number will be:
  16307.  
  16308.               Version Number = Major.Minor
  16309.  
  16310.           Example:    See XMS_Init
  16311.  
  16312.  
  16313.  
  16314.  
  16315.  
  16316.  
  16317.  
  16318.  
  16319.  
  16320.  
  16321.  
  16322.  
  16323.  
  16324.  
  16325.                     SCL1 Version 3.1 - Reference Manual - Page 266
  16326.  
  16327.  
  16328.  
  16329.  
  16330.  
  16331.  
  16332.  
  16333.                                   XMS_GlobalDisableA20, XMS_GlobalEnableA20
  16334.           -----------------------------------------------------------------
  16335.                                  XMS_GlobalDisableA20
  16336.           -----------------------------------------------------------------
  16337.  
  16338.           Purpose:    Disable the A20 line. It should only be used by
  16339.                       programs which have control of the HMA.
  16340.  
  16341.           Prototype:  int XMS_GlobalDisableA20(void);
  16342.  
  16343.           Returns:    Returns one of the following messages defined in
  16344.                       header file SCL1XMS.H:
  16345.  
  16346.                       XMS_OK if HMA if the A20 is disabled.
  16347.  
  16348.                       XMS_NOT_IMPLEMENTED if function is not implemented.
  16349.  
  16350.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  16351.  
  16352.                       XMS_A20_ERROR if an A20 error occurs.
  16353.  
  16354.                       XMS_A20_ALREADY_ENABLED if the A20 line is enabled.
  16355.  
  16356.           Parameters: None
  16357.  
  16358.           Example:    See XMS_Init
  16359.  
  16360.           -----------------------------------------------------------------
  16361.                                  XMS_GlobalEnableA20
  16362.           -----------------------------------------------------------------
  16363.  
  16364.           Purpose:    Enable the A20 line. It should only be used by
  16365.                       programs which have control of the HMA. The A20 line
  16366.                       should be turned off before a program releases
  16367.                       control of the system.
  16368.  
  16369.           Prototype:  int XMS_GlobalEnableA20(void);
  16370.  
  16371.           Returns:    Returns one of the following messages defined in
  16372.                       header file SCL1XMS.H:
  16373.  
  16374.                       XMS_OK if HMA if the A20 is enabled.
  16375.  
  16376.                       XMS_NOT_IMPLEMENTED if function is not implemented.
  16377.  
  16378.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  16379.  
  16380.                       XMS_A20_ERROR if an A20 error occurs.
  16381.  
  16382.           Parameters: None
  16383.  
  16384.           Example:    See XMS_Init
  16385.  
  16386.                     SCL1 Version 3.1 - Reference Manual - Page 267
  16387.  
  16388.  
  16389.  
  16390.  
  16391.  
  16392.  
  16393.  
  16394.                                                                    XMS_Init
  16395.           -----------------------------------------------------------------
  16396.                                        XMS_Init
  16397.           -----------------------------------------------------------------
  16398.  
  16399.           Purpose:    Initialize the Extended Memory Management functions.
  16400.                       Determine if a valid Extended Memory Manager (driver)
  16401.                       has been installed in your system.
  16402.  
  16403.           Prototype:  int XMS_Init(void);
  16404.  
  16405.           Returns:    Returns one of the following messages defined in
  16406.                       header file SCL1XMS.H:
  16407.  
  16408.                       XMS_OK if XMS has been initialized.
  16409.  
  16410.           Parameters: None
  16411.  
  16412.           Example:
  16413.  
  16414.           #include <scl1xms.h>
  16415.           #include <memory.h>
  16416.           #include <dos.h>
  16417.  
  16418.               /* eXtended (XMS) Memory functions */
  16419.  
  16420.           void Pause(void);
  16421.           void PrintA20Status(void);
  16422.           void PrintError(unsigned int Error);
  16423.           void PrintHandleInfo(int handle);
  16424.  
  16425.           typedef struct{
  16426.               unsigned int ErrorCode;
  16427.               char *ErrorMess;
  16428.               }XMSERRORS;
  16429.  
  16430.           XMSERRORS xmse[]=
  16431.               {
  16432.               XMS_NOT_IMPLEMENTED       ,"XMS function not available",
  16433.               XMS_VDISK_PRESENT         ,"Virtual Disk present",
  16434.               XMS_A20_ERROR             ,"A20 line error",
  16435.               XMS_GENERAL_DRIVER_ERROR  ,"General XMS driver error",
  16436.               XMS_UNRECOVERABLE_ERROR   ,"Unrecoverable error",
  16437.               XMS_HMA_NOT_EXIST         ,"HMA does not exist",
  16438.               XMS_HMA_IN_USE            ,"HMA already in use",
  16439.               XMS_HMA_NOT_ALLOCATED     ,"HMA is not allocated",
  16440.               XMS_A20_ALREADY_ENABLED   ,"A20 is already enabled",
  16441.               XMS_ALL_EXTENDED_ALLOCATED,"All XMS memory allocated",
  16442.               XMS_NO_MORE_HANDLES       ,"No more handles available",
  16443.               XMS_INVALID_HANDLE        ,"Invalid handle number",
  16444.               XMS_INVALID_SOURCE_HANDLE ,"Invalid source handle",
  16445.               XMS_INVALID_SOURCE_OFFSET ,"Invalid source offset",
  16446.  
  16447.                     SCL1 Version 3.1 - Reference Manual - Page 268
  16448.  
  16449.  
  16450.  
  16451.  
  16452.  
  16453.  
  16454.  
  16455.                                                                    XMS_Init
  16456.  
  16457.               XMS_INVALID_DEST_HANDLE   ,"Invalid destination handle",
  16458.               XMS_INVALID_DEST_OFFSET   ,"Invalid destination offset",
  16459.               XMS_INVALID_LENGTH        ,"Invalid length",
  16460.               XMS_INVALID_OVERLAP       ,"Invalid overlap",
  16461.               XMS_PARITY_ERROR          ,"Parity error",
  16462.               XMS_BLOCK_NOT_LOCKED      ,"Block not locked",
  16463.               XMS_BLOCK_LOCKED          ,"Block locked",
  16464.               XMS_LOCK_COUNT_OVERFLOW   ,"Lock count overflow",
  16465.               XMS_LOCK_FAIL             ,"Lock fail",
  16466.               XMS_UMB_SMALL_AVAILABLE   ,"Smaller UMB available",
  16467.               XMS_UMB_NOT_AVAILABLE     ,"UMB not available",
  16468.               XMS_UMB_INVALID_SEGMENT   ,"Invalid segment",
  16469.               };
  16470.  
  16471.           char CompOkStr[]="\tCompare OK\n";
  16472.           char CompErrStr[]="\tCompare ERROR\n";
  16473.  
  16474.           /* struct used to move or copy data from extended memory */
  16475.  
  16476.           XMSMove xmove;
  16477.  
  16478.           char TestData[80]="This string will be used to test XMS
  16479.                             functions";
  16480.  
  16481.           main()
  16482.           {
  16483.           unsigned int available,total,i,handle;
  16484.           char buffer[sizeof(TestData)];
  16485.           void far *p;
  16486.  
  16487.           /*  initialize, check if XMS driver is present */
  16488.  
  16489.           if(XMS_Init() != XMS_OK)
  16490.               {
  16491.               printf("No XMS available\n");
  16492.               exit(-1);
  16493.               }
  16494.           else
  16495.               printf("\n\nSCL1 Version 3.1 eXtended (XMS) Memory Test\n");
  16496.  
  16497.           XMS_GetVersion(&i);     /* get version number */
  16498.  
  16499.               /* add 0x30 to returned value to get ASCII code */
  16500.  
  16501.           memset(buffer,0,sizeof(buffer));
  16502.           buffer[0]=XMS_MAJOR_VER(i) + 0x30;
  16503.           buffer[1]='.';
  16504.           buffer[2]=XMS_MINOR_VER(i) + 0x30;
  16505.           printf("XMS Version %s\n\n",buffer);
  16506.  
  16507.  
  16508.                     SCL1 Version 3.1 - Reference Manual - Page 269
  16509.  
  16510.  
  16511.  
  16512.  
  16513.  
  16514.  
  16515.  
  16516.                                                                    XMS_Init
  16517.  
  16518.               /* High Memory Area Test */
  16519.  
  16520.           printf("High Memory Area (HMA) Test\n");
  16521.  
  16522.           if((i=XMS_RequestHMA())==XMS_OK)
  16523.               {
  16524.  
  16525.               /* allocated OK */
  16526.  
  16527.               printf("\tHMA allocated...\n");
  16528.  
  16529.               /* enable the A20 line so that we can access HMA */
  16530.  
  16531.               if((i=XMS_GlobalEnableA20())==XMS_OK)
  16532.                   {
  16533.  
  16534.                   _fmemcpy(XMS_HMA,(void far *)TestData,sizeof(TestData));
  16535.                   printf("\tData copied to HMA...\n");
  16536.  
  16537.                   /* copy HMA to local buffer */
  16538.  
  16539.                   memset(buffer,0,sizeof(buffer));
  16540.                   _fmemcpy((void far *)buffer,XMS_HMA,sizeof(buffer));
  16541.  
  16542.                   if(memcmp(buffer,TestData,sizeof(TestData))==0)
  16543.                       printf(CompOkStr);
  16544.                   else
  16545.                       printf(CompErrStr);
  16546.                   }
  16547.               else
  16548.  
  16549.                   printf("\tError enabling A20 line, cannot access HMA\n");
  16550.  
  16551.               /* free HMA */
  16552.  
  16553.               XMS_ReleaseHMA();
  16554.  
  16555.               printf("\tReleasing HMA...\n");
  16556.               }
  16557.           else
  16558.  
  16559.               PrintError(i);
  16560.  
  16561.           Pause();
  16562.  
  16563.               /* Extended Memory Test */
  16564.  
  16565.           printf("Extended Memory Test\n");
  16566.  
  16567.  
  16568.  
  16569.                     SCL1 Version 3.1 - Reference Manual - Page 270
  16570.  
  16571.  
  16572.  
  16573.  
  16574.  
  16575.  
  16576.  
  16577.                                                                    XMS_Init
  16578.  
  16579.           if((i=XMS_QueryFreeExtended(&available,&total))==XMS_OK &&
  16580.                available > 0)
  16581.               {
  16582.               printf("\tLargest available block: %u KB\n",available);
  16583.               printf("\tTotal available memory: %u KB\n",total);
  16584.  
  16585.               /* allocate all memory */
  16586.  
  16587.               if((i=XMS_AllocExtended(&handle,available))==XMS_OK)
  16588.                   {
  16589.                   printf("\tSuccesful allocation of %u KB...\n",available);
  16590.                   printf("\tCopying data to allocated memory...\n");
  16591.  
  16592.                   /* copy TestData buffer to extended memory */
  16593.  
  16594.                   xmove.bytes=(unsigned long)sizeof(TestData);
  16595.                   xmove.shandle=0;
  16596.                   xmove.source=(void far *)TestData;
  16597.                   xmove.dhandle=handle;
  16598.                   xmove.destination=0;
  16599.                   if((i=XMS_MoveExtended(&xmove))==XMS_OK)
  16600.                       {
  16601.  
  16602.                       /* copy extended memory to local buffer */
  16603.  
  16604.                       memset(buffer,0,sizeof(buffer));
  16605.                       xmove.bytes=sizeof(TestData);
  16606.                       xmove.shandle=handle;
  16607.                       xmove.source=0;
  16608.                       xmove.dhandle=0;
  16609.                       xmove.destination=(void far *)buffer;
  16610.                       if((i=XMS_MoveExtended(&xmove))==XMS_OK)
  16611.                          {
  16612.                          if(memcmp(TestData,buffer,sizeof(TestData))==0)
  16613.                             printf(CompOkStr);
  16614.                          else
  16615.                             printf(CompErrStr);
  16616.                          }
  16617.                       else
  16618.                          PrintError(i);
  16619.                       }
  16620.                   else
  16621.                       PrintError(i);
  16622.  
  16623.                   /* get handle information */
  16624.  
  16625.                   PrintHandleInfo(handle);
  16626.                   Pause();
  16627.  
  16628.  
  16629.  
  16630.                     SCL1 Version 3.1 - Reference Manual - Page 271
  16631.  
  16632.  
  16633.  
  16634.  
  16635.  
  16636.  
  16637.  
  16638.                                                                    XMS_Init
  16639.  
  16640.               /* Lock/Unlock Test */
  16641.  
  16642.                   printf("Lock/Unlock Test\n\tLocking allocated
  16643.                           memory...\n");
  16644.                   if((i=XMS_LockExtended(handle,&p))==XMS_OK)
  16645.                       {
  16646.                       printf("\tLocked block 32-bit linear address:
  16647.                              %lX\n",p);
  16648.                       PrintHandleInfo(handle);
  16649.                       printf("\tUnlocking allocated memory...\n");
  16650.                       XMS_UnlockExtended(handle);
  16651.                       PrintHandleInfo(handle);
  16652.                       }
  16653.                   else
  16654.                       PrintError(i);
  16655.  
  16656.                   /* Reallocating Test  */
  16657.  
  16658.                   Pause();
  16659.                   printf("Reallocating Test\n");
  16660.  
  16661.                   /* reallocate buffer to 1kb */
  16662.  
  16663.                   if((i=XMS_ReallocExtended(handle,1))==XMS_OK)
  16664.                       {
  16665.                       printf("\tBlock reallocated to 1 KB\n");
  16666.  
  16667.                       /* get handle info */
  16668.  
  16669.                       PrintHandleInfo(handle);
  16670.                       }
  16671.                   else
  16672.                       printf("\tError reallocating\n");
  16673.  
  16674.                   /* free memory */
  16675.  
  16676.                   XMS_FreeExtended(handle);
  16677.                   printf("\tReleasing Extended memory...\n");
  16678.                     }
  16679.                else
  16680.                   printf("\tError Allocating\n");
  16681.                   }
  16682.  
  16683.           Pause();
  16684.  
  16685.               /* A20 Line Test */
  16686.  
  16687.           printf("A20 Line Test\n");
  16688.           PrintA20Status();
  16689.  
  16690.  
  16691.                     SCL1 Version 3.1 - Reference Manual - Page 272
  16692.  
  16693.  
  16694.  
  16695.  
  16696.  
  16697.  
  16698.  
  16699.                                                                    XMS_Init
  16700.           if((i=XMS_LocalEnableA20())==XMS_OK)
  16701.               {
  16702.               printf("\tLocally enabling A20 line...\n");
  16703.               XMS_LocalEnableA20();
  16704.               PrintA20Status();
  16705.  
  16706.               printf("\tLocally disabling A20 line...\n");
  16707.               XMS_LocalDisableA20();
  16708.               PrintA20Status();
  16709.               }
  16710.           else
  16711.               PrintError(i);
  16712.  
  16713.           Pause();
  16714.  
  16715.               /* Upper Memory Blocks Test  */
  16716.  
  16717.           printf("Upper Memory Block (UMB) Test\n");
  16718.  
  16719.               /*  By requesting 0xffff paragraphs, the largest available
  16720.                   block size will be reported if UMB blocks are available*/
  16721.  
  16722.           if((i=XMS_RequestUMB(0xffff,&p,&available))==XMS_OK ||
  16723.               i==XMS_UMB_SMALL_AVAILABLE)
  16724.               {
  16725.               printf("\tUMB available, allocating largest block
  16726.                       available...\n");
  16727.               if(i==XMS_UMB_SMALL_AVAILABLE)
  16728.                   {
  16729.                   if((i=XMS_RequestUMB(available,&p,&available))!=XMS_OK)
  16730.                       PrintError(i);
  16731.                   else
  16732.                       {
  16733.                       printf("\tUMB Size: %li bytes\n\tUMB Address: %X\n",
  16734.                             (long) available * 16L,FP_SEG(p));
  16735.                       printf("\tCopying data to allocated memory...\n");
  16736.                       _fmemcpy(p,(void far *)TestData,sizeof(TestData));
  16737.                       memset(buffer,0,sizeof(buffer));
  16738.                       _fmemcpy((void far *)buffer,p,sizeof(TestData));
  16739.                       if(memcmp(buffer,TestData,sizeof(TestData))==0)
  16740.                          printf(CompOkStr);
  16741.                       else
  16742.                          printf(CompErrStr);
  16743.                       printf("\tReleasing UMB...\n");
  16744.                       XMS_ReleaseUMB(p);
  16745.                       }
  16746.                   }
  16747.               }
  16748.           else
  16749.               PrintError(i);
  16750.           }
  16751.  
  16752.                     SCL1 Version 3.1 - Reference Manual - Page 273
  16753.  
  16754.  
  16755.  
  16756.  
  16757.  
  16758.  
  16759.  
  16760.                                                                    XMS_Init
  16761.  
  16762.           void PrintError(unsigned int Error)
  16763.           {
  16764.           int i;
  16765.  
  16766.           for(i=0;i < sizeof(xmse) /sizeof(XMSERRORS);++i)
  16767.               {
  16768.               if(xmse[i].ErrorCode==Error)
  16769.                   {
  16770.                   printf("\t%s\n",xmse[i].ErrorMess);
  16771.                   return;
  16772.                   }
  16773.               }
  16774.           printf("\tUnknown error #%X\n",Error);
  16775.           }
  16776.  
  16777.           void Pause(void)
  16778.           {
  16779.           printf("-- more --");
  16780.           GetKey();
  16781.           printf("\r          \n");
  16782.           }
  16783.  
  16784.           void PrintHandleInfo(int handle)
  16785.           {
  16786.           int lcount,fhandle,bsize;
  16787.  
  16788.           XMS_GetEMBHandleInfo(handle,&lcount,&fhandle,&bsize);
  16789.           printf("\tHandle Report:\n");
  16790.           printf("\t\tFree Handles: %i\n",fhandle);
  16791.           printf("\t\tAllocated Block Lock Count: %i\n",lcount);
  16792.           printf("\t\tAllocated Block Size: %i KB\n",bsize);
  16793.           }
  16794.  
  16795.           void PrintA20Status(void)
  16796.           {
  16797.           unsigned int i;
  16798.           int j;
  16799.  
  16800.           if((j=XMS_QueryA20(&i))==XMS_OK)
  16801.               {
  16802.               if(i==XMS_A20_ENABLED)
  16803.                   printf("\tA20 enabled\n");
  16804.               else
  16805.                   printf("\tA20 NOT enabled\n");
  16806.               }
  16807.           else
  16808.               PrintError(j);
  16809.           }
  16810.  
  16811.  
  16812.  
  16813.                     SCL1 Version 3.1 - Reference Manual - Page 274
  16814.  
  16815.  
  16816.  
  16817.  
  16818.  
  16819.  
  16820.  
  16821.                                     XMS_LocalDisableA20, XMS_LocalEnableA20
  16822.           -----------------------------------------------------------------
  16823.                                  XMS_LocalDisableA20
  16824.           -----------------------------------------------------------------
  16825.  
  16826.           Purpose:    Cancels a previous call to the XMS_LocalEnableA20
  16827.                       function. It should only be used by programs which
  16828.                       need direct access to extended memory.
  16829.  
  16830.           Prototype:  int XMS_LocalDisableA20(void);
  16831.  
  16832.           Returns:    Returns one of the following messages defined in
  16833.                       header file SCL1XMS.H:
  16834.  
  16835.                       XMS_OK if HMA if the A20 is disabled.
  16836.  
  16837.                       XMS_NOT_IMPLEMENTED if function is not implemented.
  16838.  
  16839.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  16840.  
  16841.                       XMS_A20_ERROR if an A20 error occurs.
  16842.  
  16843.                       XMS_A20_ALREADY_ENABLED if the A20 line is enabled.
  16844.  
  16845.           Parameters: None
  16846.  
  16847.           -----------------------------------------------------------------
  16848.                                   XMS_LocalEnableA20
  16849.           -----------------------------------------------------------------
  16850.  
  16851.           Purpose:    Enables the A20 line. It should only be used by
  16852.                       programs which need direct access to extended memory.
  16853.                       Programs which use this function should disable the
  16854.                       A20 line before releasing control of the system.
  16855.  
  16856.           Prototype:  int XMS_LocalEnableA20(void);
  16857.  
  16858.           Returns:    Returns one of the following messages defined in
  16859.                       header file SCL1XMS.H:
  16860.  
  16861.                       XMS_OK if HMA if the A20 is enabled.
  16862.  
  16863.                       XMS_NOT_IMPLEMENTED if function is not implemented.
  16864.  
  16865.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  16866.  
  16867.                       XMS_A20_ERROR if an A20 error occurs.
  16868.  
  16869.           Parameters: None
  16870.  
  16871.           Example:    See XMS_Init
  16872.  
  16873.  
  16874.                     SCL1 Version 3.1 - Reference Manual - Page 275
  16875.  
  16876.  
  16877.  
  16878.  
  16879.  
  16880.  
  16881.  
  16882.                                                            XMS_LockExtended
  16883.           -----------------------------------------------------------------
  16884.                                    XMS_LockExtended
  16885.           -----------------------------------------------------------------
  16886.  
  16887.           Purpose:    Locks an extended memory block and returns its base
  16888.                       address. Locked memory blocks are guaranteed not to
  16889.                       move. The 32-bit pointer is only valid while the
  16890.                       block is locked. Locked blocks should be unlocked as
  16891.                       soon as possible. A block does not have to be locked
  16892.                       before using XMS_MoveExtended function.
  16893.  
  16894.           Prototype:  int XMS_LockExtended(int handle,void far **bpt);
  16895.  
  16896.           Returns:    Returns one of the following messages defined in
  16897.                       header file SCL1XMS.H:
  16898.  
  16899.                       XMS_OK if the block is locked.
  16900.  
  16901.                       XMS_NOT_IMPLEMENTED if the function is not
  16902.                       implemented.
  16903.  
  16904.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  16905.  
  16906.                       XMS_INVALID_HANDLE if the handle is invalid.
  16907.  
  16908.                       XMS_LOCK_COUNT_OVERFLOW if the block's lock count
  16909.                       overflows.
  16910.  
  16911.                       XMS_LOCK_FAIL if the lock fails.
  16912.  
  16913.           Parameters:
  16914.  
  16915.               handle - an unsigned integer value that holds a 16-bit handle
  16916.               to the allocated block.
  16917.  
  16918.               bpt - pointer to a far pointer that will hold the 32 bit
  16919.               address of the memory block.
  16920.  
  16921.           Example:    See XMS_Init
  16922.  
  16923.  
  16924.  
  16925.  
  16926.  
  16927.  
  16928.  
  16929.  
  16930.  
  16931.  
  16932.  
  16933.  
  16934.  
  16935.                     SCL1 Version 3.1 - Reference Manual - Page 276
  16936.  
  16937.  
  16938.  
  16939.  
  16940.  
  16941.  
  16942.  
  16943.                                                            XMS_MoveExtended
  16944.           -----------------------------------------------------------------
  16945.                                    XMS_MoveExtended
  16946.           -----------------------------------------------------------------
  16947.  
  16948.           Purpose:    Transfers a block of data from one location to
  16949.                       another. It is primarily used for moving blocks of
  16950.                       data between conventional memory and extended memory,
  16951.                       however it can be used for moving blocks within
  16952.                       conventional memory and within extended memory.
  16953.  
  16954.           Prototype:  int XMS_MoveExtended(XMSMove *);
  16955.  
  16956.           Returns:    Returns one of the following messages defined in
  16957.                       header file SCL1XMS.H:
  16958.  
  16959.                       XMS_OK if the move is successful.
  16960.  
  16961.                       XMS_NOT_IMPLEMENTED if function is not implemented.
  16962.  
  16963.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  16964.  
  16965.                       XMS_INVALID_SOURCE_HANDLE if shandle is invalid.
  16966.  
  16967.                       XMS_INVALID_SOURCE_OFFSET if the Source Offset
  16968.                       (*source)is invalid.
  16969.  
  16970.                       XMS_INVALID_DEST_HANDLE if dhandle is invalid.
  16971.  
  16972.                       XMS_INVALID_DEST_OFFSET if the Destination Offset
  16973.                       (*destination) is invalid.
  16974.  
  16975.                       XMS_INVALID_LENGTH if the length (bytes) is invalid,
  16976.                       must me a pair number.
  16977.  
  16978.                       XMS_INVALID_OVERLAP if the move has an invalid
  16979.                       overlap.
  16980.  
  16981.                       XMS_PARITY_ERROR if a parity error occurs.
  16982.  
  16983.                       XMS_A20_ERROR if an A20 error occurs.
  16984.  
  16985.           Parameters: The function receives a pointer to a XMSMove type
  16986.                       structure as follows:
  16987.  
  16988.           typedef struct{
  16989.               unsigned long bytes;   Number of bytes to transfer.
  16990.  
  16991.               unsigned int shandle;  Handle of source block. This value
  16992.                                      will be "0" if the source block
  16993.                                      belongs to conventional memory.
  16994.  
  16995.  
  16996.                     SCL1 Version 3.1 - Reference Manual - Page 277
  16997.  
  16998.  
  16999.  
  17000.  
  17001.  
  17002.  
  17003.  
  17004.                                              XMS_MoveExtended, XMS_QueryA20
  17005.  
  17006.               void far *source;      If shandle is set to "0", this pointer
  17007.                                      is a standard segment:offset pair to
  17008.                                      memory that is directly accessible by
  17009.                                      the processor. If shandle is not "0"
  17010.                                      this variable is a 32 bit offset to
  17011.                                      extended memory block.
  17012.  
  17013.               unsigned int dhandle;  Handle of destination block. This
  17014.                                      value will be "0" if the source block
  17015.                                      belongs to conventional memory.
  17016.  
  17017.               void far *destination; If dhandle is set to "0", this pointer
  17018.                                      is a standard segment:offset pair to
  17019.                                      memory that is directly accessible by
  17020.                                      the processor. If dhandle is not "0"
  17021.                                      this variable is a 32 bit offset to
  17022.                                      extended memory block.
  17023.               }XMSMove;
  17024.  
  17025.           Example:    See XMS_Init
  17026.  
  17027.           -----------------------------------------------------------------
  17028.                                      XMS_QueryA20
  17029.           -----------------------------------------------------------------
  17030.  
  17031.           Purpose:    This function checks to see if the A20 line is
  17032.                       physically enabled. It does this in a hardware
  17033.                       independent manner by seeing if "memory wrap" occurs.
  17034.  
  17035.           Prototype:  int XMS_QueryA20(int *A20status);
  17036.  
  17037.           Returns:    Returns one of the following messages defined in
  17038.                       header file SCL1XMS.H:
  17039.  
  17040.                       XMS_A20_NOT_ENABLED message if the A20 line is not
  17041.                       physically enabled.
  17042.  
  17043.                       XMS_A20_ENABLED message if the A20 line is enabled.
  17044.  
  17045.                       XMS_NOT_IMPLEMENTED if function is not implemented.
  17046.  
  17047.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  17048.  
  17049.           Parameter:  A20status - pointer to an integer value that will
  17050.                       hold the A20 line status. It is used to return this
  17051.                       status to the calling program.
  17052.  
  17053.           Example:    See XMS_Init
  17054.  
  17055.  
  17056.  
  17057.                     SCL1 Version 3.1 - Reference Manual - Page 278
  17058.  
  17059.  
  17060.  
  17061.  
  17062.  
  17063.  
  17064.  
  17065.                                  XMS_QueryFreeExtended, XMS_ReallocExtended
  17066.           -----------------------------------------------------------------
  17067.                                 XMS_QueryFreeExtended
  17068.           -----------------------------------------------------------------
  17069.  
  17070.           Purpose:    Returns the size of the largest available extended
  17071.                       memory block in the system. The HMA is not included
  17072.                       in the returned value even if it is not in use.
  17073.  
  17074.           Prototype:  int XMS_QueryFreeExtended (unsigned int *FreeKB,
  17075.                           unsigned int *TotalKB);
  17076.  
  17077.           Returns:    Returns one of the following messages defined in
  17078.                       header file SCL1XMS.H:
  17079.  
  17080.                       XMS_NOT_IMPLEMENTED if function is not implemented.
  17081.  
  17082.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  17083.  
  17084.                       XMS_ALL_EXTENDED_ALLOCATED if all extended memory is
  17085.                       allocated.
  17086.  
  17087.           Parameters:
  17088.  
  17089.               FreeKB - pointer to an unsigned integer that will hold the
  17090.               size of the largest free extended memory block in K-bytes.
  17091.  
  17092.               TotalKB - pointer to an unsigned integer value that will hold
  17093.               total amount of free extended memory in K-bytes.
  17094.  
  17095.           Example:    See XMS_Init
  17096.  
  17097.           -----------------------------------------------------------------
  17098.                                  XMS_ReallocExtended
  17099.           -----------------------------------------------------------------
  17100.  
  17101.           Purpose:    Attempts to reallocate an unlocked extended memory
  17102.                       block so that it becomes the newly specified size.
  17103.  
  17104.           Prototype:  int XMS_ReallocExtended(int handle,
  17105.                          unsigned int newsize);
  17106.  
  17107.           Returns:    Returns one of the following messages defined in
  17108.                       header file SCL1XMS.H:
  17109.  
  17110.                       XMS_OK if the block is reallocated.
  17111.  
  17112.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  17113.  
  17114.                       XMS_NOT_IMPLEMENTED if function is not implemented.
  17115.  
  17116.                       XMS_INVALID_HANDLE if the handle is invalid.
  17117.  
  17118.                     SCL1 Version 3.1 - Reference Manual - Page 279
  17119.  
  17120.  
  17121.  
  17122.  
  17123.  
  17124.  
  17125.  
  17126.                       XMS_ReallocExtended - XMS_ReleaseHMA - XMS_RequestHMA
  17127.  
  17128.                       XMS_BLOCK_LOCKED if the block is not locked
  17129.  
  17130.                       XMS_ALL_EXTENDED_ALLOCATED if all available extended
  17131.                       memory is allocated.
  17132.  
  17133.                       XMS_NO_MORE_HANDLES if all available extended memory
  17134.                       handles are in use.
  17135.  
  17136.           Parameters:
  17137.  
  17138.               handle - unsigned integer value that holds a handle to the
  17139.               unlocked extended memory block to reallocate.
  17140.  
  17141.               newsize - pointer to an unsigned integer value that holds the
  17142.               new size for the extended memory block in K-bytes.
  17143.  
  17144.           Example:    See XMS_Init
  17145.  
  17146.           -----------------------------------------------------------------
  17147.                             XMS_ReleaseHMA, XMS_RequestHMA
  17148.           -----------------------------------------------------------------
  17149.  
  17150.           Purpose:    These functions attempt to reserve and release the
  17151.                       64K-16 byte high memory area (HMA) to allow other
  17152.                       programs to use it. Programs which allocate the HMA
  17153.                       must release it before exiting.
  17154.  
  17155.           Prototype:  int XMS_ReleaseHMA(void);
  17156.                       int XMS_RequestHMA(void);
  17157.  
  17158.           Returns:    Returns one of the following messages defined in
  17159.                       header file SCL1XMS.H:
  17160.  
  17161.                       XMS_OK if HMA if the HMA is successfully assigned
  17162.                       (XMS_RequestHMA) or released (XMS_ReleaseHMA).
  17163.  
  17164.                       XMS_NOT_IMPLEMENTED if function is not implemented.
  17165.  
  17166.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  17167.  
  17168.                       XMS_HMA_NOT_EXIST if the HMA does not exist.
  17169.  
  17170.                       XMS_HMA_NOT_ALLOCATED if the HMA was not allocated.
  17171.  
  17172.                       XMS_HMA_IN_USE is already in use.
  17173.  
  17174.           Parameters: None
  17175.  
  17176.           Example:    See XMS_Init
  17177.  
  17178.  
  17179.                     SCL1 Version 3.1 - Reference Manual - Page 280
  17180.  
  17181.  
  17182.  
  17183.  
  17184.  
  17185.  
  17186.  
  17187.                                             XMS_ReleaseUMB - XMS_RequestUMB
  17188.           -----------------------------------------------------------------
  17189.                                     XMS_ReleaseUMB
  17190.           -----------------------------------------------------------------
  17191.  
  17192.           Purpose:    Frees a previously allocated Upper Memory Block
  17193.                       (UMB). When an UMB has been released, any code or
  17194.                       data stored in it becomes invalid and should not be
  17195.                       accessed.
  17196.  
  17197.           Prototype:  int XMS_ReleaseUMB(void far *UMBpt);
  17198.  
  17199.           Returns:    Returns one of the following messages defined in
  17200.                       header file SCL1XMS.H:
  17201.  
  17202.                       XMS_OK if the block was released.
  17203.  
  17204.                       XMS_NOT_IMPLEMENTED if the function is not
  17205.                       implemented.
  17206.  
  17207.                       XMS_UMB_INVALID_SEGMENT if the UMB segment number is
  17208.                       invalid.
  17209.  
  17210.           Parameter:  UMBpt - far pointer to the segment number of the
  17211.                       upper memory block.
  17212.  
  17213.           Example:    See XMS_Init
  17214.  
  17215.           -----------------------------------------------------------------
  17216.                                     XMS_RequestUMB
  17217.           -----------------------------------------------------------------
  17218.  
  17219.           Purpose:    Attempts to allocate an Upper Memory Block (UMB). If
  17220.                       the function fails, the size of the largest free UMB
  17221.                       is returned. UMBs are located below the 1MB address
  17222.                       boundary. The A20 Line does not need to be enabled
  17223.                       before accessing an allocated UMB. UMBs are paragraph
  17224.                       aligned. To determine the size of the largest
  17225.                       available UMB, attempt to allocate one with a size of
  17226.                       FFFFh.
  17227.  
  17228.           Prototype:  int XMS_RequestUMB(unsigned int para,
  17229.                          void far **UMBpt,unsigned int *ActualSize);
  17230.  
  17231.           Returns:    Returns one of the following messages defined in
  17232.                       header file SCL1XMS.H:
  17233.  
  17234.                       XMS_OK if the request is granted.
  17235.  
  17236.                       XMS_NOT_IMPLEMENTED if the function is not
  17237.                       implemented.
  17238.  
  17239.  
  17240.                     SCL1 Version 3.1 - Reference Manual - Page 281
  17241.  
  17242.  
  17243.  
  17244.  
  17245.  
  17246.  
  17247.  
  17248.                                         XMS_RequestUMB - XMS_UnlockExtended
  17249.  
  17250.                       XMS_UMB_NOT_AVAILABLE if no UMBs are available.
  17251.  
  17252.           Parameters:
  17253.  
  17254.               para - size of requested memory block in paragraphs. One
  17255.               paragraph is 16 Bytes of memory (unsigned int.)
  17256.  
  17257.               UMBpt - pointer to a far pointer to the segment number of the
  17258.               upper memory block if the request is granted.
  17259.  
  17260.               ActualSize - pointer to an unsigned integer value that will
  17261.               hold the actual size of the allocated block in paragraphs or
  17262.               the size of the largest available UMB in paragraphs (unsigned
  17263.               integer).
  17264.  
  17265.           Example:    See XMS_Init
  17266.  
  17267.           -----------------------------------------------------------------
  17268.                                   XMS_UnlockExtended
  17269.           -----------------------------------------------------------------
  17270.  
  17271.           Purpose:    Unlocks a locked extended memory block. Pointers into
  17272.                       the block become invalid and should no longer be
  17273.                       used.
  17274.  
  17275.           Prototype:  int XMS_UnlockExtended(int handle);
  17276.  
  17277.           Returns:    Returns one of the following messages defined in
  17278.                       header file SCL1XMS.H:
  17279.  
  17280.                       XMS_OK if the block is unlocked.
  17281.  
  17282.                       XMS_VDISK_PRESENT if a VDISK device is detected.
  17283.  
  17284.                       XMS_NOT_IMPLEMENTED if the function is not
  17285.                       implemented.
  17286.  
  17287.                       XMS_INVALID_HANDLE if the handle is invalid.
  17288.  
  17289.                       XMS_BLOCK_NOT_LOCKED if the block is not locked
  17290.  
  17291.           Parameter:  handle - unsigned integer value that holds a handle
  17292.                       to the allocated block.
  17293.  
  17294.           Example:    See XMS_Init
  17295.  
  17296.  
  17297.  
  17298.  
  17299.  
  17300.  
  17301.                     SCL1 Version 3.1 - Reference Manual - Page 282
  17302.  
  17303.  
  17304.  
  17305.  
  17306.  
  17307.  
  17308.  
  17309.                                                                       YesNo
  17310.           -----------------------------------------------------------------
  17311.                                         YesNo
  17312.           -----------------------------------------------------------------
  17313.  
  17314.           Purpose:    Displays a YES/NO query box with mouse control
  17315.                       buttons.  The original screen is restored on exit.
  17316.  
  17317.           Prototype:  int YesNo(int NColor,int RColor,int Selection,
  17318.                          char *p);
  17319.  
  17320.           Returns:    A value of "1" is returned if YES is selected. A
  17321.                       value of "2" if NO is selected.  You can use the
  17322.                       YN_YES and YN_NO constants defined in SCL1.H.
  17323.  
  17324.           Parameters:
  17325.  
  17326.               NColor - color for the YES/NO box (integer).
  17327.  
  17328.               RColor - color of the selected option (integer).
  17329.  
  17330.               Selection - default selection (integer).
  17331.  
  17332.               p - pointer to the question whose answer is seeked.
  17333.  
  17334.           Example:
  17335.  
  17336.           #include <scl1.h>
  17337.           #include <scl1clor.h>
  17338.  
  17339.           int Color1=WHITE_BLACK;
  17340.           int Color2=BLACK_WHITE;
  17341.           #define OK      1
  17342.           #define CANCEL  2
  17343.  
  17344.           main()
  17345.           {
  17346.           YN_SetPosition(4,10);   /* Set position of the YesNo box to the
  17347.                                      upper left corner of the screen */
  17348.  
  17349.               /* use YN_SetUserLang to modify prompts to OK and CANCEL */
  17350.           YN_SetUserLang("< OK >",2,0x1800,"< CANCEL >",11,0x2e00);
  17351.  
  17352.           do
  17353.               {
  17354.               if(YesNo(Color1,Color2,OK,"Turn YesNo Box\nShadow On?")==OK)
  17355.                   YesNoShadowOn();
  17356.               if(YesNo(Color1,Color2,OK,"Turn YesNo Box\nShadow Off?")==OK)
  17357.                   YesNoShadowOff();
  17358.               }while(YesNo(Color1,Color2,CANCEL,"Exit to DOS?")!= OK);
  17359.           }
  17360.  
  17361.  
  17362.                     SCL1 Version 3.1 - Reference Manual - Page 283
  17363.  
  17364.  
  17365.  
  17366.  
  17367.  
  17368.  
  17369.  
  17370.                              YesNoShadowOff - YesNoShadowOn - YNSetPosition
  17371.           -----------------------------------------------------------------
  17372.                             YesNoShadowOff, YesNoShadowOn
  17373.           -----------------------------------------------------------------
  17374.  
  17375.           Purpose:    Displays or disable a shadow effect when using the
  17376.                       YesNo function. After any of these functions is
  17377.                       called all subsequent calls to the YesNo function
  17378.                       will be displayed with (or without) a shadow effect.
  17379.  
  17380.           Prototype:  void YesNoShadowOff(void);
  17381.                       void YesNoShadowOn(void);
  17382.  
  17383.           Returns:    Nothing.
  17384.  
  17385.           Parameters: None.
  17386.  
  17387.           Example:    See YesNo
  17388.  
  17389.           See YNSetPosition and YN_SetUserLang.
  17390.  
  17391.           -----------------------------------------------------------------
  17392.                                     YNSetPosition
  17393.           -----------------------------------------------------------------
  17394.  
  17395.           Purpose:    Permits changing the position of a YesNo display to
  17396.                       any place in the screen.
  17397.  
  17398.           Prototype:  void YN_SetPosition(int UpperRow,int LeftCol);
  17399.  
  17400.           Returns:    Nothing
  17401.  
  17402.           Parameters:
  17403.  
  17404.               UpperRow - upper row position of the YesNo box (integer).
  17405.  
  17406.               LeftCol - left column position of the YesNo box (integer).
  17407.  
  17408.           Example:    See YesNo
  17409.  
  17410.           See YesNoShadowOff, YesNoShadowOn and YN_SetUserLang.
  17411.  
  17412.  
  17413.  
  17414.  
  17415.  
  17416.  
  17417.  
  17418.  
  17419.  
  17420.  
  17421.  
  17422.  
  17423.                     SCL1 Version 3.1 - Reference Manual - Page 284
  17424.  
  17425.  
  17426.  
  17427.  
  17428.  
  17429.  
  17430.  
  17431.                                                              YN_SetUserLang
  17432.           -----------------------------------------------------------------
  17433.                                     YN_SetUserLang
  17434.           -----------------------------------------------------------------
  17435.  
  17436.           Purpose:    Modify the default YesNo prompts with your own
  17437.                       prompts.
  17438.  
  17439.           Prototype:  void YN_SetUserLang(char *prompt1,int offset1,
  17440.                          unsigned int key1,char *prompt2,int offset2,
  17441.                          unsigned int key2);
  17442.  
  17443.           Returns:    Nothing
  17444.  
  17445.           Parameters:
  17446.  
  17447.               prompt1 - char pointer to the first prompt, the "Yes" option.
  17448.  
  17449.               offset1 - position from the border of the box where to
  17450.               display the first prompt (integer).
  17451.  
  17452.               key1 - scan code of the key to be used for selecting prompt1
  17453.               (unsigned int).
  17454.  
  17455.               prompt2 - char pointer to the second prompt, the "No" option.
  17456.  
  17457.               offset2 - position from the border of the box where to
  17458.               display the second prompt (integer).
  17459.  
  17460.               key2 - scan code of the key to be used for selecting prompt2
  17461.               (unsigned int).
  17462.  
  17463.           Example:    See YesNo
  17464.  
  17465.           See YesNoShadowOff, YesNoShadowOn and YNSetPosition.
  17466.  
  17467.  
  17468.  
  17469.  
  17470.  
  17471.  
  17472.  
  17473.  
  17474.  
  17475.  
  17476.  
  17477.  
  17478.  
  17479.  
  17480.  
  17481.  
  17482.  
  17483.  
  17484.                     SCL1 Version 3.1 - Reference Manual - Page 285
  17485.  
  17486.  
  17487.  
  17488.  
  17489.  
  17490.  
  17491.  
  17492.                                                                 YN_SetFrame
  17493.           -----------------------------------------------------------------
  17494.                                      YN_SetFrame
  17495.           -----------------------------------------------------------------
  17496.  
  17497.           Purpose:    Modify the default YesNo frame type.
  17498.  
  17499.           Prototype:  void YN_SetFrame(int FrameType);
  17500.  
  17501.           Returns:    Nothing
  17502.  
  17503.           Parameters:
  17504.  
  17505.               FrameType - any of the frame types defined in Box or GSSBox
  17506.               (integer).
  17507.  
  17508.           See YesNo, YesNoShadowOff, YesNoShadowOn and YNSetPosition.
  17509.  
  17510.  
  17511.  
  17512.  
  17513.  
  17514.  
  17515.  
  17516.  
  17517.  
  17518.  
  17519.  
  17520.  
  17521.  
  17522.  
  17523.  
  17524.  
  17525.  
  17526.  
  17527.  
  17528.  
  17529.  
  17530.  
  17531.  
  17532.  
  17533.  
  17534.  
  17535.  
  17536.  
  17537.  
  17538.  
  17539.  
  17540.  
  17541.  
  17542.  
  17543.  
  17544.  
  17545.                     SCL1 Version 3.1 - Reference Manual - Page 286
  17546.  
  17547.  
  17548.  
  17549.  
  17550.  
  17551.  
  17552.  
  17553.                                                                     ZWindow
  17554.           -----------------------------------------------------------------
  17555.                                        ZWindow
  17556.           -----------------------------------------------------------------
  17557.  
  17558.           Purpose:    Restores a screen area with a zooming effect.
  17559.  
  17560.           Prototype:  void ZWindow(int Color,int UpperRow,int LeftCol,
  17561.                          int LowerRow,int RightCol,int Frame,char* Buffer);
  17562.  
  17563.           Returns:    Nothing
  17564.  
  17565.           Parameters:
  17566.  
  17567.               Color - color for the area to be restored (integer).
  17568.  
  17569.               UpperRow - upper left row position of the area (integer).
  17570.  
  17571.               LeftCol - upper left column position of the area (integer).
  17572.  
  17573.               LowerRow - lower right row position of the area (integer).
  17574.  
  17575.               RightCol - lower right column position of the area (integer).
  17576.  
  17577.               Frame - frame type to be used (integer).
  17578.  
  17579.               Buffer - pointer to a buffer that holds the screen
  17580.               information. The buffer size is the number of characters * 2.
  17581.               This size can be calculated by using the W_BUF_SIZE macro
  17582.               defined in SCL1.H.
  17583.  
  17584.           Example:    See Window
  17585.  
  17586.  
  17587.  
  17588.  
  17589.  
  17590.  
  17591.  
  17592.  
  17593.  
  17594.  
  17595.  
  17596.  
  17597.  
  17598.  
  17599.  
  17600.  
  17601.  
  17602.  
  17603.  
  17604.  
  17605.  
  17606.                     SCL1 Version 3.1 - Reference Manual - Page 287
  17607.  
  17608.  
  17609.  
  17610.  
  17611.  
  17612.  
  17613.  
  17614.                         Appendix "A" - File Related Functions
  17615.  
  17616.         SCL1's file related functions rely on DOS services to work with files.
  17617.         They provide an alternative to the standard library functions with an
  17618.         easier way to trap and display error related information.
  17619.  
  17620.         You can classify errors in two groups; critical and non-critical. 
  17621.         Critical errors are those that generate an interrupt 0x24 (a disk
  17622.         drive door left opened, for example). This type of error generates the
  17623.         DOS message "Retry, Abort, Ignore?". Non-critical errors (file not
  17624.         found, for example) are reported by the system but do not generate an
  17625.         interrupt 0x24.
  17626.  
  17627.         SCL1 functions handles non-critical errors in a simple way. Most file
  17628.         functions return zero if the operation was successful, otherwise they
  17629.         return the DOS error code. Your program can then process the error
  17630.         code or you can call the ErrorBox function that will display it. You
  17631.         can change the ErrorBox default error messages (see ErrorBox).
  17632.  
  17633.         SCL1 has the TratInt24 function to deal with DOS critical errors. Call
  17634.         this function at the beginning of your program (it must be done only
  17635.         once) and any subsequent critical errors will be handled by SCL1. If
  17636.         DOS generates an interrupt 0x24, instead of its standard message, a
  17637.         window will be opened in the screen and a message indicating the type
  17638.         of error, asking the user if he wants or not to retry operation, will
  17639.         be displayed. On exit the original screen will be restored.
  17640.  
  17641.         Once you have initialized TrapInt24, SCL1's file related functions
  17642.         will return -1 to indicate a DOS critical error if the user decided
  17643.         NOT TO retry the operation. If the user decides to retry the operation
  17644.         and it is completed successfully, no error code is reported.
  17645.  
  17646.         As you see, trapping critical errors and non-critical errors can be
  17647.         easily integrated to your program by using TrapInt24 and ErrorBox.
  17648.         SCL1's way of displaying error message is specially appropriate for
  17649.         programs that are not command-line oriented. Also notice that you
  17650.         don't have to use ErrorBox when a critical error is reported since
  17651.         TrapInt24 has its own way of displaying error messages.
  17652.  
  17653.         Refer to the DOS Technical Reference for more information about error
  17654.         code numbers.
  17655.  
  17656.         The following pseudo-code shows how to deal with errors:
  17657.  
  17658.                 Returned error code > than 0 ?
  17659.                     Call ErrorBox with error number.
  17660.                 Error code = -1 ?
  17661.                     DOS Critical error, the user choose not to retry
  17662.                     operation. No need to call ErrorBox since the error
  17663.                     message has already been displayed by TrapInt24.
  17664.                 else
  17665.                     Operation was successful.
  17666.  
  17667.                     SCL1 Version 3.1 - Reference Manual - Page 288
  17668.  
  17669.  
  17670.  
  17671.  
  17672.  
  17673.  
  17674.  
  17675.                         Appendix "A" - File Related Functions
  17676.  
  17677.         The following list show the most common DOS error codes:
  17678.  
  17679.                     2     File not found
  17680.                     3     Path not found
  17681.                     4     No handles left
  17682.                     5     Access denied
  17683.                     6     Invalid handle
  17684.                     15    Invalid drive
  17685.                     16    Attempt to remove current directory
  17686.                     29    Write Fault
  17687.                     30    Read Fault
  17688.  
  17689.             SCL1's Error codes:
  17690.  
  17691.                     255   File too big   (used by File2Buf)
  17692.                     -1    Dos Critical error
  17693.                     -2    Drive not valid (used by GetDiskFreeSpace)
  17694.  
  17695.         SCL1 gives you direct access to DOS file related functions. You need
  17696.         to understand DOS's way of working with files for using them. There
  17697.         are many books that could help you. The general procedure is:
  17698.  
  17699.             You must first open or create a file. Use OpenFile to open an
  17700.             existing file (error is reported if the file is not found) or
  17701.             CreateFile to create a file, if the file is not found or truncates
  17702.             an existing file to 0. When you open or create a file DOS gives
  17703.             you a "Handle". A handle is a number that you will use to refer to
  17704.             this file when performing any other operations like reading,
  17705.             writing, etc.
  17706.  
  17707.             Once you have a handle to a file you can write or read data. To do
  17708.             it use ReadFile or WriteFile. These functions will read or write
  17709.             any number of bytes to or from a buffer you specify. Files
  17710.             functions under DOS have a read/write pointer. When you read 200
  17711.             bytes the file pointer will point to byte 201. This means that
  17712.             next time you read, you will read byte 201. This pointer is
  17713.             automatically moved by ReadFile and WriteFile. You can move this
  17714.             pointer using MoveFilePt and MoveFilePt2Offset.
  17715.  
  17716.             Once you have finished working with your file, you must close the
  17717.             file using CloseFile.
  17718.  
  17719.             As you see working with files under DOS is a three step process:
  17720.             1) Open/Create File, 2) Read/Write, 3) Close File.
  17721.  
  17722.             SCL1 offers another way to work with files. You can read a file to
  17723.             a buffer or write a buffer to a file in just one step using
  17724.             File2Buf and Buf2Disk. You don't have to care about opening or
  17725.             closing files with this functions. But you will have to read or
  17726.             write the whole file/buffer when you use them.
  17727.  
  17728.                     SCL1 Version 3.1 - Reference Manual - Page 289
  17729.  
  17730.  
  17731.  
  17732.  
  17733.  
  17734.  
  17735.  
  17736.                         Appendix "B" - Mouse Related Functions
  17737.  
  17738.         SCL1 mouse related functions are based on an interrupt service routine
  17739.         (ISR) that updates a series of variables according to the mouse
  17740.         current state. If you do not initialize this ISR you would not be able
  17741.         to use the mouse routines. They can be initialized in several ways.
  17742.  
  17743.         The CheckMouse function can be used to check if the mouse hardware/
  17744.         software is installed:
  17745.  
  17746.                     if(CheckMouse())
  17747.                        we have a mouse !
  17748.  
  17749.         Once you have verified that the mouse is installed you should reset
  17750.         the mouse software to its defaults using ResetMouse and then proceed
  17751.         to install the ISR using SetMouseIsr:
  17752.  
  17753.                     if(CheckMouse())
  17754.                        {
  17755.                        ResetMouse();
  17756.                        SetMouseIsr();
  17757.  
  17758.         Now you can call any mouse related functions. Before returning to DOS
  17759.         the program must un-install the ISR using ResetMouse(). Failure to do
  17760.         so might cause unpredictable problems.
  17761.  
  17762.         These steps can be simplified by using the InitMouse function that
  17763.         performs all the above operations including resetting the ISR:
  17764.  
  17765.         If you want a visible mouse cursor use:
  17766.  
  17767.                 InitMouse(IM_SHOW);
  17768.  
  17769.         If you want an invisible mouse cursor use:
  17770.  
  17771.                 InitMouse(IM_NO_SHOW);
  17772.  
  17773.         Once the mouse is initialized a series of variables are updated
  17774.         according to mouse events (see SetMouseIsr). Your program can check
  17775.         these variables to read the mouse position and the mouse buttons
  17776.         state. If you change video modes you should reset the mouse and re-
  17777.         initialize it. The re-initialization MUST NOT be done using InitMouse:
  17778.  
  17779.                 InitMouse(IM_SHOW);
  17780.                     ResetMouse();
  17781.                     SetVideoMode(1);
  17782.                     if(CheckMouse())
  17783.                        {
  17784.                        ResetMouse();
  17785.                        SetMouseIsr();
  17786.                        ShowMouse();
  17787.                        }
  17788.  
  17789.                     SCL1 Version 3.1 - Reference Manual - Page 290
  17790.  
  17791.  
  17792.  
  17793.  
  17794.  
  17795.  
  17796.  
  17797.                        Appendix "C" - Screen Related Functions
  17798.  
  17799.         SCL1's screen related functions write directly to the video buffer.
  17800.         Configuration according to monitor type is done automatically when the
  17801.         first screen related function is called. During this process, SCL1's
  17802.         Video function will determine the type of monitor, the video buffer
  17803.         address and if it is necessary to wait for retrace to reduce snow.
  17804.  
  17805.         To find about the video configuration your program will be using you
  17806.         should call VideoConfig. This function returns a pointer to a
  17807.         structure that holds the information about the current video adapter.
  17808.         The structure format is as follows:
  17809.  
  17810.         struct VideoData{
  17811.             int Monitor;           /* Monitor type */
  17812.             int Mode;              /* Active video mode */
  17813.             int Page;              /* Active video page */
  17814.             int Lines;             /* Number of lines in video mode */
  17815.             int Cols;              /* Number of columns in video mode */
  17816.             unsigned int Segment;  /* video buffer segment address */
  17817.             int Retrace;           /* =1 if retrace is to be done */
  17818.             };
  17819.  
  17820.         Monitor types are define in SCL1.H :
  17821.  
  17822.             VC_MDA     = Monochrome
  17823.             VC_CGA     = CGA monitor
  17824.             VC_EGA     = EGA monitor
  17825.             VC_EGAM    = EGA with monochrome monitor
  17826.             VC_PGC     = Professional graphic
  17827.             VC_VGAM    = VGA / monochrome
  17828.             VC_VGA     = VGA
  17829.             VC_MCGADC  = MCGA Digital
  17830.             VC_MCGAAM  = MCGA Analog/mono
  17831.             VC_MCGAAC  = MCGA Analog/color
  17832.  
  17833.         If you do not need all the video information you can call Video. This
  17834.         functions returns whether the monitor is color or mono:
  17835.  
  17836.             if(Video()==COLOR)
  17837.                 color monitor
  17838.             else
  17839.                 mono monitor
  17840.  
  17841.         NOTE: COLOR & MONO are defined in SCL1.H as the segment address of the
  17842.         Video Buffer (0xb800 for color 0xb000 for mono).
  17843.  
  17844.  
  17845.  
  17846.  
  17847.  
  17848.  
  17849.  
  17850.                     SCL1 Version 3.1 - Reference Manual - Page 291
  17851.  
  17852.  
  17853.  
  17854.  
  17855.  
  17856.  
  17857.  
  17858.                        Appendix "C" - Screen Related Functions
  17859.  
  17860.         SCL1 video functions work only in alphanumeric video modes.  You can
  17861.         initialize your system to one of these modes (3 in case of color, 7 in
  17862.         case of mono) by calling InitVideo at the beginning of your program. 
  17863.         Most of the times this won't be necessary since they are the default
  17864.         modes, but is not a bad idea to use InitVideo just to make sure.  Be
  17865.         aware that when you call InitVideo the screen will be cleared and the
  17866.         cursor moved to the screen's home position. Remember that version 2.0
  17867.         of SCL1 supports only video modes 0 - 3 and 7.
  17868.  
  17869.         SCL1's screen related functions always write to the active video page.
  17870.         You can change the video page using SetVideoPage. Be sure to specify a
  17871.         valid page for your system. You can force a function to write to a
  17872.         non-active video page by modifying the VC_Page variable before calling
  17873.         the desired video function, be sure to restore the correct value of
  17874.         VC_Page.
  17875.  
  17876.         Retrace will be done only if a CGA type adapter is found.  SCL1
  17877.         functions will not wait for the video retrace if an EGA adapter is
  17878.         found.  Yet you can force them to do the retrace by changing the
  17879.         variable VC_Retrace to 1. For example:
  17880.  
  17881.             if(Video()==COLOR)
  17882.                 VC_Retrace=1;
  17883.  
  17884.         You must set this variable to 1 AFTER having called Video or any other
  17885.         screen related function.
  17886.  
  17887.         EGA 43 lines and VGA 50 lines are now supported by SCL1. SetVideo4350
  17888.         sets the mode to 43 or 50 lines depending on the monitor you have.
  17889.         SetVideo25 restores video mode to the default 25 lines.
  17890.  
  17891.  
  17892.  
  17893.  
  17894.  
  17895.  
  17896.  
  17897.  
  17898.  
  17899.  
  17900.  
  17901.  
  17902.  
  17903.  
  17904.  
  17905.  
  17906.  
  17907.  
  17908.  
  17909.  
  17910.  
  17911.                     SCL1 Version 3.1 - Reference Manual - Page 292
  17912.  
  17913.  
  17914.  
  17915.  
  17916.  
  17917.  
  17918.  
  17919.                            Appendix "D" - SCL1 Header Files
  17920.  
  17921.         SCL1.H - SCL1 structures, functions prototypes and constant
  17922.         definitions.
  17923.  
  17924.         SCL1KEYS.H - SCAN-ASCII code of most used keys. F1 - F10 (with shift,
  17925.         alt and control), numeric key-pad keys and A-Z (with alt and control),
  17926.         and the extra keys that enhanced keyboards have (F11 - F12, etc) are
  17927.         defined.
  17928.  
  17929.         SCL1CLOR.H - Color definitions.
  17930.  
  17931.             Example: WHITE_BLUE stands for white characters on blue
  17932.             background.
  17933.  
  17934.             Colors can be highlighted and the blink attribute is also defined.
  17935.             Example:
  17936.  
  17937.                 WHITE_RED | HIGHLIGHT
  17938.                 WHITE_RED | BLINK
  17939.  
  17940.         SCL1HUGE.H - Definition of huge functions.
  17941.  
  17942.         SCL1SND.H - Definition of musical notes frequency in hertz to be used
  17943.         with sound related functions.
  17944.  
  17945.                 Syntax  TS_X[y]?,  were:
  17946.  
  17947.                 TS = TSound id
  17948.                     X = musical note (C,D,E,F,G,A,B)
  17949.                     y = s means sharp, f means flat (optional)
  17950.                     ? = octave (1 - 7)
  17951.  
  17952.                 Examples: TS_Df4 = D flat, fourth octave
  17953.                           TS_C4 = C, fourth octave (middle C)
  17954.  
  17955.         SCL1EMS - This header file includes the function prototypes for the
  17956.         Expanded Memory Functions.
  17957.  
  17958.         SCL1XMS - This header file includes the function prototypes for the
  17959.         Extended Memory Functions.
  17960.  
  17961.  
  17962.  
  17963.  
  17964.  
  17965.  
  17966.  
  17967.  
  17968.  
  17969.  
  17970.  
  17971.  
  17972.                     SCL1 Version 3.1 - Reference Manual - Page 293
  17973.  
  17974.  
  17975.  
  17976.  
  17977.  
  17978.  
  17979.  
  17980.                          Appendix "E" - Dialog Type Functions
  17981.  
  17982.         SCL1 includes several functions that utilize a dialog scheme. The idea
  17983.         behind these functions is to make them as flexible as possible,
  17984.         permitting the programmer to set or specify any available parameter.
  17985.         This flexibility adds complexity and, in order to make them as
  17986.         friendly as possible, a dialog scheme has been used.
  17987.  
  17988.         During program development a need arises to perform a complex task.
  17989.         For example; let's say you need to get user input, but you want to add
  17990.         the flexibility of being able to check for a help key or for a
  17991.         keystroke combination that will insert a block at the current cursor
  17992.         position. You might need a window were the user can browse through a
  17993.         list of items, and you want to know exactly at any moment what item is
  17994.         being highlighted by the user so that you can display help information
  17995.         or show the selected item in another window. These types of
  17996.         requirements usually require you to write a custom procedure. Most
  17997.         library functions are not designed to handle these special
  17998.         requirements. The dialog type functions have been designed to permit
  17999.         you to handle these types of problems.
  18000.  
  18001.         To permit this type of flexibility, the dialog type functions make use
  18002.         of message interchanges. You can call the function as many times as
  18003.         required, each time requesting an action. The function will return a
  18004.         message that gives you the results or status of the requested action.
  18005.  
  18006.         The general way to use this functions is as follows. You can call the
  18007.         function with an initialization message. This will take care of
  18008.         initializing the structure elements to some predetermined values and
  18009.         setting the function's initial conditions.  Then you can call the
  18010.         function with a message requesting a display.  This will instruct the
  18011.         function to draw or display to the screen the desired object (like a
  18012.         scroll window display). Now that there is a display you will like to
  18013.         make the function active so that it can perform the desired task.
  18014.         While the function is active it will keep sending back messages
  18015.         informing you of what is happening, for example, that an illegal key
  18016.         has been pressed (so display an error or help message, or beep the
  18017.         console to warn the user, etc.) or that the cursor has changed
  18018.         position, etc. You can then analyze these returned messages and
  18019.         respond with a given action or you can ignore them. In fact, you can
  18020.         request the function to do anything it is capable of doing, for
  18021.         example, in the case of data entry field (like LineEditor), to move
  18022.         the cursor to any position, reformat or even change the data, insert a
  18023.         new character, etc. The messages have been defined in the header file
  18024.         as english-like messages to permit a friendly interface.
  18025.  
  18026.         Most of the parameters needed to configure the functions are included
  18027.         as elements of one or several structures. These structure(s) need to
  18028.         be initialized before the function is called. They contain many
  18029.         parameters and it might look as if they involve much effort to define.
  18030.         With the aid of SSG (SCL1 Screen Generator) you can define them very
  18031.         easily. Refer to the included SSG reference manual.
  18032.  
  18033.                     SCL1 Version 3.1 - Reference Manual - Page 294
  18034.  
  18035.  
  18036.  
  18037.  
  18038.  
  18039.  
  18040.  
  18041.                          Appendix "E" - Dialog Type Functions
  18042.  
  18043.         SENDING MESSAGES TO DIALOG TYPE FUNCTIONS
  18044.  
  18045.         Every effort has been made to make the dialog functions as uniform as
  18046.         possible. Most functions use the same messages to perform similar
  18047.         tasks.
  18048.  
  18049.         INITIALIZING THE PARAMETER STRUCTURES:
  18050.  
  18051.             You can define the parameter structures in two different ways. One
  18052.             way is to indicate a value for each parameter. The other way is to
  18053.             call the functions with a "INIT" message, this will assign default
  18054.             values to most parameters, that you can later modify. Which method
  18055.             to use depends on how many of the parameters you will like to have
  18056.             control of.
  18057.  
  18058.             For example, let us initialize a ScrollWindow structure using the
  18059.             two methods:
  18060.  
  18061.             1) Using SW_INIT message:
  18062.  
  18063.             #include <scl1.h>
  18064.  
  18065.             /* This is the data you want to display in your scroll window */
  18066.  
  18067.             char *swdbuf[]={
  18068.                 "First Item",
  18069.                 "Second Item",
  18070.                 0};
  18071.  
  18072.             main()
  18073.             {
  18074.                 SWData swd;
  18075.                 /* This initializes the structures to the default values (see
  18076.                 each function description for details). Once it has been
  18077.                 initialized you need to modify only the desired parameters */
  18078.  
  18079.                 ScrollWindow(SW_INIT,&swd);
  18080.  
  18081.                 /* Modify the size of our scroll window */
  18082.  
  18083.                 swd.UpperRow=6;
  18084.                 swd.LeftCol=26;
  18085.                 swd.LowerRow=17;
  18086.                 swd.RightCol=52;
  18087.  
  18088.                 /* And specify our data address */
  18089.  
  18090.                 swd.Buffer=swdbuf;
  18091.  
  18092.  
  18093.  
  18094.                     SCL1 Version 3.1 - Reference Manual - Page 295
  18095.  
  18096.  
  18097.  
  18098.  
  18099.  
  18100.  
  18101.  
  18102.                          Appendix "E" - Dialog Type Functions
  18103.  
  18104.             2) Defining the structure as static data:
  18105.  
  18106.             #include <scl1.h>
  18107.  
  18108.             /* This is the data you want to display in your scroll window */
  18109.  
  18110.             char *swdbuf[]={
  18111.                 "First Item",
  18112.                 "Second Item",
  18113.                 0};
  18114.  
  18115.             /* All the parameters required to define the Scroll Window go into
  18116.             this structure (size, color, position, etc.). */
  18117.  
  18118.             SWData swd={7,15,6,26,17,52,0,1,15,swdbuf,0,0," Scroll             
  18119.             Window",7,0,0,0,0,0,0,0,0,0,0,0,0,0};
  18120.  
  18121.             /* Since all the parameters have been defined there is no need to
  18122.             change any of them */
  18123.  
  18124.         THE "RESET" MESSAGE:
  18125.  
  18126.             Dialog function structures have several position related
  18127.             variables.  When you declare your structure as static data you do
  18128.             not need to call the function with an "INIT" message. You should
  18129.             call the function with a "RESET" message to make sure that all
  18130.             these variables are reset. This message also checks for undefined
  18131.             ExitKeys an sets this element to default values if the have not
  18132.             been defined.
  18133.  
  18134.             Let us continue with the previous example of an application of the
  18135.             ScrollWindow function. Let us assume that the structure has been
  18136.             defined as static data. Our program should look like this:
  18137.  
  18138.             main()
  18139.                 {
  18140.  
  18141.                 /* The RESET message resets the internal position related
  18142.                 variables (in this case, it makes sure that we start at the
  18143.                 first item. It also checks for any parameter that may have not
  18144.                 been specified in the structure (in this example the ExitKeys
  18145.                 have not been specified). You should always call a dialog
  18146.                 function using the "RESET" message when you are not using the
  18147.                 "INIT" message unless you desire the cursor to appear over an
  18148.                 specific item */
  18149.  
  18150.                 ScrollWindow(SW_RESET,&swd);
  18151.                 }
  18152.  
  18153.  
  18154.  
  18155.                     SCL1 Version 3.1 - Reference Manual - Page 296
  18156.  
  18157.  
  18158.  
  18159.  
  18160.  
  18161.  
  18162.  
  18163.                          Appendix "E" - Dialog Type Functions
  18164.  
  18165.         THE "DRAW" MESSAGE:
  18166.  
  18167.             Once your structure is defined and initialized you can send
  18168.             messages to it.  The first message usually is "DRAW", this message
  18169.             instructs the function to display the information to the screen.
  18170.  
  18171.             In our example using the ScrollWindow function the "DRAW" message
  18172.             should be sent like this:
  18173.             ScrollWindow(SW_DRAW,&swd);
  18174.  
  18175.             After sending this message you should see a the Scroll Window
  18176.             displayed in the screen.
  18177.  
  18178.         THE "ACTIVE" MESSAGE:
  18179.  
  18180.             The "ACTIVE" message permits you to have the function perform the
  18181.             specific task it has been designed to do. Messages are constantly
  18182.             returned by the dialog type function. If you are using the
  18183.             LineEditor function, the "ACTIVE" message permits you to edit the
  18184.             entry field, for the ScrollWindow function, this message lets you
  18185.             browse through the window, etc.
  18186.  
  18187.             When you send this message the function will retain the program
  18188.             control until some event occurs. For example, in the case of
  18189.             ScrollWindow, if the user presses the DOWN or UP arrow keys to
  18190.             change a highlighted item, ScrollWindow will return a NEW_POSITION
  18191.             message. If the user presses an undefined key (it could be F1 to
  18192.             request Help) an ILLEGAL_KEY message is returned. You can ignore
  18193.             the returned message or respond to it. In our previous example of
  18194.             a the ScrollWindow function the code should look like this:
  18195.  
  18196.             do
  18197.                 {
  18198.                 Mess=ScrollWindow(SW_BROWSE,&swd);
  18199.                 }while(Mess != SW_EXIT_KEY);
  18200.  
  18201.             Since when an "ACTIVE" message is sent the function retains the
  18202.             program control until an event occurs, we should place this
  18203.             function call within in a loop. In this case any returned message
  18204.             is ignored except "EXIT_KEY" which means that a key defined as an
  18205.             exit key has been pressed. The user will be able to browse until
  18206.             one of these keys is pressed. Exit Keys can individually be
  18207.             defined for each function. You can add any desired Exit Keys by
  18208.             defining a null-terminated array were all the ExitKeys' SCAN/ASCII
  18209.             codes values are specified, for example:
  18210.  
  18211.             unsigned int MyExitKeys[]={ESC,ENTER,0};
  18212.  
  18213.             NOTE: This example needs header file SCL1KEYS.H.
  18214.  
  18215.  
  18216.                     SCL1 Version 3.1 - Reference Manual - Page 297
  18217.  
  18218.  
  18219.  
  18220.  
  18221.  
  18222.  
  18223.  
  18224.                          Appendix "E" - Dialog Type Functions
  18225.  
  18226.             Once you have defined your Exits Keys you initialize the structure
  18227.             ExitKeys element:
  18228.  
  18229.             swd.ExitKeys=MyExitKeys;
  18230.  
  18231.             You can also call the function with the "INIT" and "RESET"
  18232.             messages to set the ExitKeys to default values (see each function
  18233.             description)
  18234.  
  18235.         THE "POSITION_BEGIN" MESSAGE
  18236.  
  18237.             When you call the function with this message the cursor moves to
  18238.             the start of the data buffer.
  18239.  
  18240.         The "POSITION_END" MESSAGE
  18241.  
  18242.             When you call the function with this message the cursor moves to
  18243.             the end of the data buffer.
  18244.  
  18245.         The "POSITION_UP" MESSAGE
  18246.  
  18247.             When you call the function with this message the cursor moves one
  18248.             position towards the end of the data buffer in the LineEditor
  18249.             function, to the next field for the Fields2 function and to the
  18250.             next item in all other functions.
  18251.  
  18252.         The "POSITION_DOWN" MESSAGE
  18253.  
  18254.             When you call the function with this message the cursor moves one
  18255.             position towards the start of the data buffer in the LineEditor
  18256.             function, to the next field for the Fields2 function and to the
  18257.             next item in all other functions.
  18258.  
  18259.         The "SET_POSITION" MESSAGE
  18260.  
  18261.             When you call the function with this message the cursor moves to
  18262.             the specified position. This function call requires you to send an
  18263.             additional parameter (see explanation below).
  18264.  
  18265.         The "CHECK_MOUSE" MESSAGE
  18266.  
  18267.             Normally Dialog type functions handle the mouse input by
  18268.             themselves but when you have several Dialog type functions at the
  18269.             same time on the screen and your program detects that the mouse
  18270.             has been clicked you can send this message to any dialog function.
  18271.             If the mouse was clicked inside a function screen area it will
  18272.             return a MY_MOUSE message, in any other case it returns a
  18273.             MOUSE_EVENT message. This call is useful for determining under
  18274.             what conditions the mouse has been clicked.
  18275.  
  18276.  
  18277.                     SCL1 Version 3.1 - Reference Manual - Page 298
  18278.  
  18279.  
  18280.  
  18281.  
  18282.  
  18283.  
  18284.  
  18285.                          Appendix "E" - Dialog Type Functions
  18286.  
  18287.         MESSAGES THAT DIALOG TYPE FUNCTIONS CAN RETURN
  18288.  
  18289.         THE "OK" MESSAGE.
  18290.  
  18291.             This message is returned when you have called a Dialog type
  18292.             function with the "DRAW", "INIT" or "RESET" messages, and the
  18293.             action was performed as requested.
  18294.  
  18295.         THE "EXIT_KEY" MESSAGE.
  18296.  
  18297.             This message is returned when one of the keys, defined as an Exit
  18298.             Key, has been pressed. It's SCAN/ASCII code is stored in the
  18299.             structure element "EventInfo".
  18300.  
  18301.         THE "ILLEGAL_KEY" MESSAGE:
  18302.  
  18303.             Each function uses several keys (like PgUp, PgDn etc.) to perform
  18304.             common operations and checks for the use of the defined ExitKeys.
  18305.             If any other key is pressed, it returns an ILLEGAL_KEY message and
  18306.             stores the key's SCAN/ASCII code in the structure's EventInfo
  18307.             element.
  18308.  
  18309.             You can respond to this message for performing a given action. 
  18310.             Let us see an example in which we use the ILLEGAL_KEY message to
  18311.             display a help screen and at the same time display the highlighted
  18312.             item in a secondary window:
  18313.  
  18314.             do
  18315.                 {
  18316.                 Mess=ScrollWindow(SW_ACTIVE,&swd);
  18317.  
  18318.                 if(Mess==SW_ILLEGAL_KEY) /* Illegal key pressed? */
  18319.  
  18320.                     {
  18321.  
  18322.                     /* The structure's EventInfo element is common to all
  18323.                     Dialog function. It holds the value of the key that was
  18324.                     pressed when you receive and EXIT_KEY or ILLEGAL KEY
  18325.                     message. */
  18326.  
  18327.                     if(swd.EventInfo == F1) /* Help Key? */
  18328.  
  18329.                     ... Display help code would go here ....
  18330.  
  18331.                 else               /* Unknown key */
  18332.  
  18333.                     ... Display error message, beep etc.
  18334.  
  18335.                     }
  18336.  
  18337.  
  18338.                     SCL1 Version 3.1 - Reference Manual - Page 299
  18339.  
  18340.  
  18341.  
  18342.  
  18343.  
  18344.  
  18345.  
  18346.                          Appendix "E" - Dialog Type Functions
  18347.  
  18348.                     /* Let's now display the highlighted item in a secondary
  18349.                     window, the structure Position element can be used as an
  18350.                     index to our data array */
  18351.  
  18352.                     WriteScreen(7,24,30,swdbuf[swd.Position]);
  18353.                 }while(Mess != SW_EXIT_KEY);
  18354.  
  18355.             You can send other messages while you're inside this loop. For
  18356.             example, in this loop the item at the cursor position is deleted
  18357.             from the list when the DELETE key is pressed:
  18358.             do
  18359.                 {
  18360.                 Mess=ScrollWindow(SW_BROWSE,&swd);
  18361.  
  18362.                 if(Mess == SW_ILLEGAL_KEY && swd.EventInfo == DEL)
  18363.                     {
  18364.  
  18365.                     /* DeleteItem would be an user defined function that
  18366.                     deletes an item from your list */
  18367.  
  18368.                     DeleteItem(swd.Position);
  18369.  
  18370.                     /* Now redraw your data */
  18371.  
  18372.                 Mess=ScrollWindow(SW_DRAW,&swd);
  18373.  
  18374.                 }while(Mess != SW_EXIT_KEY);
  18375.  
  18376.         THE "MOUSE EVENT" MESSAGE
  18377.  
  18378.             This message is returned when the mouse has been clicked outside
  18379.             the function screen area. You can check mouse variables MSE_LpX
  18380.             and MSE_LpY to get the actual position were the mouse was clicked.
  18381.  
  18382.         THE "MY_MOUSE" MESSAGE
  18383.  
  18384.             When you send a "CHECK_MOUSE" message to a dialog function it
  18385.             checks if the mouse was clicked inside it's screen area. In this
  18386.             case it will return a "MY_MOUSE" message. You can then send an
  18387.             "ACTIVE" messages so that the function gets control and services
  18388.             the mouse event. In the case the mouse was clicked outside it's
  18389.             screen area a "MOUSE_EVENT" message is returned.
  18390.  
  18391.         THE "BUFFER_END" MESSAGE
  18392.  
  18393.             This message is returned when the user has tried to move the
  18394.             cursor passed the last element (or end) of the buffer. This
  18395.             message can be safely ignored unless you want to display an error
  18396.             or warning. (This message is not supported by all Dialog
  18397.             functions).
  18398.  
  18399.                     SCL1 Version 3.1 - Reference Manual - Page 300
  18400.  
  18401.  
  18402.  
  18403.  
  18404.  
  18405.  
  18406.  
  18407.                          Appendix "E" - Dialog Type Functions
  18408.  
  18409.         THE "BUFFER_BEGIN" MESSAGE
  18410.  
  18411.             This message is returned when the user has tried to move the
  18412.             cursor passed the first element (or beginning) of buffer. This
  18413.             message can be safely ignored unless you want to display an error
  18414.             or warning. (This message is not supported by all Dialog
  18415.             functions).
  18416.  
  18417.         THE "ILLEGAL_POSITION" MESSAGE
  18418.  
  18419.             This message is returned when you send a "SET_POSITION" message
  18420.             but the position parameter is not valid.
  18421.  
  18422.         THE "NEW_POSITION" MESSAGE
  18423.  
  18424.             This message is returned when the user has moved the cursor to a
  18425.             new position. You can get the current position from the "Position"
  18426.             structure element.
  18427.  
  18428.         Every effort has been made to make these functions to be called very
  18429.         similarly.
  18430.  
  18431.  
  18432.         STRUCTURE ELEMENTS COMMON TO ALL DIALOG FUNCTIONS:
  18433.  
  18434.         The following structure elements are common to all Dialog type
  18435.         functions:
  18436.  
  18437.         Colors - Colors are defined using one or more of the following
  18438.         structure elements:
  18439.  
  18440.                   Color - For functions that use only one color.
  18441.  
  18442.             Functions that use more than one color:
  18443.  
  18444.                  NColor - Normal Color
  18445.                  RColor - Reversed Color
  18446.                  HColor - Highlight Color
  18447.                  TColor - Color used to tag items.
  18448.  
  18449.         Screen Position - Screen coordinates are specified using one or more
  18450.         of the following structure elements:
  18451.  
  18452.                 Row,Col - Row & column position.
  18453.  
  18454.                 UpperRow,LowerRow,LeftCol,RightCol - Used in functions that
  18455.                 must define a screen area. UpperRow/LeftCol indicate the
  18456.                 window's top left coordinate and LowerRow/RightCol the lower
  18457.                 right corner.
  18458.  
  18459.  
  18460.                     SCL1 Version 3.1 - Reference Manual - Page 301
  18461.  
  18462.  
  18463.  
  18464.  
  18465.  
  18466.  
  18467.  
  18468.                          Appendix "E" - Dialog Type Functions
  18469.  
  18470.         EventInfo - When the user press an undefined key or an exit key it's
  18471.         SCAN/ASCII code value is stored in this element.
  18472.  
  18473.         ExitKeys - Pointer to a null-terminated array of unsigned integers. It
  18474.         must be initialized to the SCAN/ASCII code values of the keys that are
  18475.         to be defined as ExitKeys. (see the examples above).
  18476.  
  18477.             NOTE: ExitKeys are checked by Dialog Functions before the default
  18478.             editing keys. This means you can override a defined editing key or
  18479.             invalidate its use by defining it as an ExitKey.
  18480.  
  18481.         Position - This element holds the current cursor position. Some
  18482.         functions may have more than one variable.
  18483.  
  18484.         ADDITIONAL PARAMETERS 
  18485.  
  18486.         Some messages (for example SET_POSITION) require that you send an
  18487.         additional parameter. This parameter is always the last parameter:
  18488.  
  18489.             NewPosition=123;
  18490.             ScrollWindow(SW_SET_POSITION,&swd,NewPosition);
  18491.  
  18492.         In this example, the new position is specified by the NewPosition
  18493.         variable.
  18494.  
  18495.         FUNCTIONS DERIVED FROM DIALOG FUNCTIONS
  18496.  
  18497.         Dialog functions offer a lot of power and flexibility. Several of the
  18498.         new functions included in this version of SCL1 utilize them. These new
  18499.         functions follow the general working procedure of the "INIT", "RESET",
  18500.         "DRAW" and "ACTIVE" messages previously described, but they retain the
  18501.         program control until on of the ExitKeys is pressed. In future
  18502.         versions of SCL1 a monitoring facility will be added to this functions
  18503.         to improve their flexibility. The FileBox2 and WFileBox are examples
  18504.         of these dialog derived functions. The next example shows how to use
  18505.         these functions:
  18506.  
  18507.             #include <scl1.h>
  18508.  
  18509.             main()
  18510.             {
  18511.             FBData fbd;
  18512.             char buffer[80];
  18513.  
  18514.             memset(buffer,0,sizeof(buffer));
  18515.             FileBox2(FB_INIT,&fbd); /* Initialize */
  18516.  
  18517.             fbd.UpperRow=10;    /* Modify size & position */
  18518.             fbd.LeftCol=20;
  18519.             fbd.LowerRow=20;
  18520.  
  18521.                     SCL1 Version 3.1 - Reference Manual - Page 302
  18522.  
  18523.  
  18524.  
  18525.  
  18526.  
  18527.  
  18528.  
  18529.                          Appendix "E" - Dialog Type Functions
  18530.  
  18531.             fbd.RightCol=60;
  18532.             fbd.Buffer=buffer;     /* Use our buffer */
  18533.  
  18534.             FileBox2(FB_DRAW,&fbd);
  18535.             FileBox2(FB_ACTIVE,&fbd);
  18536.             }
  18537.  
  18538.         Its important to know if a function is a true DIALOG function or a
  18539.         DIALOG-DERIVED function.
  18540.  
  18541.  
  18542.  
  18543.  
  18544.  
  18545.  
  18546.  
  18547.  
  18548.  
  18549.  
  18550.  
  18551.  
  18552.  
  18553.  
  18554.  
  18555.  
  18556.  
  18557.  
  18558.  
  18559.  
  18560.  
  18561.  
  18562.  
  18563.  
  18564.  
  18565.  
  18566.  
  18567.  
  18568.  
  18569.  
  18570.  
  18571.  
  18572.  
  18573.  
  18574.  
  18575.  
  18576.  
  18577.  
  18578.  
  18579.  
  18580.  
  18581.  
  18582.                     SCL1 Version 3.1 - Reference Manual - Page 303
  18583.  
  18584.  
  18585.  
  18586.  
  18587.  
  18588.  
  18589.  
  18590.                        Appendix "F" - Extended Memory Functions
  18591.  
  18592.         SCL1's extended memory handling functions adhere to the Extended
  18593.         Memory Specifications (XMS), version 2.0, jointly developed by
  18594.         Microsoft Corporation, Lotus Development Corporation, Intel
  18595.         Corporation, and AST Research, Inc. These specifications are the
  18596.         copyright and property of Microsoft Corporation, Lotus Development
  18597.         Corporation, Intel Corporation, and AST Research, Inc. In this
  18598.         Appendix, some information has been literally copied or adapted from
  18599.         these specifications.
  18600.  
  18601.         It is beyond the scope of this appendix to explain in detail the
  18602.         Extended Memory Specifications or how to use them in your programs. It
  18603.         is recommended that you obtain the XMS specification document from any
  18604.         of its developers in order to take full advantage of these functions.
  18605.  
  18606.         Extended Memory allows programs to utilize additional memory found in
  18607.         Intel's 80286 and 80386 based machines. The XMS specifications allow a
  18608.         consistent and machine independent manner to handle this memory. With
  18609.         some restrictions, XMS adds almost 64K to the 640K which programs can
  18610.         access directly. Depending on available hardware, XMS may provide even
  18611.         more memory to DOS programs. XMS also provides programs with a
  18612.         standard method of storing data in extended memory.
  18613.  
  18614.         In order to use the Extended Memory function and XMS driver must be
  18615.         installed in your system by including a DEVICE= statement in the
  18616.         machine's CONFIG.SYS file. It must be installed prior to any other
  18617.         devices or TSRs which use it.
  18618.  
  18619.         DEFINITIONS:
  18620.  
  18621.             Extended Memory - Memory in 80286 and 80386 based machines which
  18622.             is located above the 1MB address boundary.
  18623.  
  18624.             High Memory Area (HMA) - The first 64K of extended memory. The
  18625.             High Memory Area is unique because code can be executed in it
  18626.             while in real mode. The HMA officially starts at FFFF:10h and ends
  18627.             at FFFF:FFFFh making it 64K-16 bytes in length.
  18628.  
  18629.             Upper Memory Blocks (UMBs) - Blocks of memory available on some
  18630.             80x86 based machines which are located between DOS's 640K limit
  18631.             and the 1MB address boundary. The number, size, and location of
  18632.             these blocks vary widely depending upon the types of hardware
  18633.             adapter cards installed in the machine.
  18634.  
  18635.             Extended Memory Blocks (EMBs) - Blocks of extended memory located
  18636.             above the HMA which can only be used for data storage.
  18637.  
  18638.             A20 Line - The 21st address line of 80x86 CPUs. Enabling the A20
  18639.             line allows access to the HMA.
  18640.  
  18641.  
  18642.  
  18643.                     SCL1 Version 3.1 - Reference Manual - Page 304
  18644.  
  18645.  
  18646.  
  18647.  
  18648.  
  18649.  
  18650.  
  18651.                        Appendix "F" - Extended Memory Functions
  18652.  
  18653.             XMM - Extended Memory Manager.  A DOS device driver which
  18654.             implements XMS.  XMMs are machine specific but allow programs to
  18655.             use extended memory in a machine-independent manner. For example;
  18656.             HIMEM.SYS, currently distributed by Microsoft.
  18657.  
  18658.         USING XMS FUNCTIONS:
  18659.  
  18660.         To use SCL1's XMS functions first, the program should determine if an
  18661.         XMS driver is installed.  It can then use any of the available XMS
  18662.         functions. The following list show the correspondence of SCL1's XMS
  18663.         functions to the function numbers in the XMS specifications. 
  18664.  
  18665.                 SCL1 Function            XMS Function Number
  18666.                 -----------------------  -------------------
  18667.                 XMS_Init
  18668.                 XMS_GetVersion                   0
  18669.                 XMS_RequestHMA                   1
  18670.                 XMS_ReleaseHMA                   2
  18671.                 XMS_GlobalEnableA20              3
  18672.                 XMS_GlobalDisableA20             4
  18673.                 XMS_LocalEnableA20               5
  18674.                 XMS_LocalDisableA20              6
  18675.                 XMS_QueryA20                     7
  18676.                 XMS_QueryFreeExtended            8
  18677.                 XMS_AllocExtended                9
  18678.                 XMS_FreeExtended                10
  18679.                 XMS_MoveExtended                11
  18680.                 XMS_LockExtended                12
  18681.                 XMS_UnlockExtended              13
  18682.                 XMS_GetEMBHandleInfo            14
  18683.                 XMS_ReallocExtended             15
  18684.                 XMS_RequestUMB                  16
  18685.                 XMS_ReleaseUMB                  17
  18686.  
  18687.  
  18688.  
  18689.  
  18690.  
  18691.  
  18692.  
  18693.  
  18694.  
  18695.  
  18696.  
  18697.  
  18698.  
  18699.  
  18700.  
  18701.  
  18702.  
  18703.  
  18704.                     SCL1 Version 3.1 - Reference Manual - Page 305
  18705.  
  18706.  
  18707.  
  18708.  
  18709.  
  18710.  
  18711.  
  18712.                        Appendix "G" - Expanded Memory Functions
  18713.  
  18714.         SCL1's Expanded Memory Functions adhere to the LIM version 4.0
  18715.         specifications. Because they are standardized, you avoid potential
  18716.         compatibility problems with other expanded memory programs that also
  18717.         adhere to the memory manager specification. Most standard functions
  18718.         are included, although not all advanced LIM functions have been
  18719.         implemented. In order to use the EMM functions your system must have
  18720.         expanded memory capabilities and a suitable Expanded Memory Manager
  18721.         should have been installed. In this Appendix, some information has
  18722.         been literally copied or adapted from these specifications.
  18723.  
  18724.         It is beyond the scope of this appendix to explain in detail the
  18725.         Expanded Memory Specifications or how to use them in your programs. It
  18726.         is recommended that you obtain the LIM specification document from any
  18727.         of its developers in order to take full advantage of these functions.
  18728.  
  18729.         USING EXPANDED MEMORY FUNCTIONS
  18730.  
  18731.         The general procedure to use the EMS functions is: Determine if EMM is
  18732.         installed by calling the EMS_Init function.  Determine if enough
  18733.         expanded memory pages exist for your application. Allocate expanded
  18734.         memory pages. Get the page frame base address. Map in expanded memory
  18735.         pages. Read/write/execute data in expanded memory, just as if it were
  18736.         conventional memory. Return expanded memory pages to expand memory
  18737.         pool before exiting.
  18738.  
  18739.         The following list show the correspondence of SCL1's EMS functions to
  18740.         the function numbers in the EMS specifications. 
  18741.  
  18742.                 SCL1 Function            EMM Function Number
  18743.                 -----------------------  -------------------
  18744.                 EMS_Status                       1
  18745.                 EMS_PageAdress                   2
  18746.                 EMS_AvailableLogPages            3
  18747.                 EMS_Alloc                        4
  18748.                 EMS_Map                          5
  18749.                 EMS_Free                         6
  18750.                 EMS_Version                      7
  18751.                 EMS_SavePageMap                  8
  18752.                 EMS_RestorePageMap               9
  18753.                 EMS_GetHandleCount              12
  18754.                 EMS_GetHandlePages              13
  18755.                 EMS_GetAllHandlePages           14
  18756.                 EMS_MapMultipleEMS              17
  18757.                 EMS_Realloc                     18
  18758.                 EMS_GetHandleName               20
  18759.                 EMS_SetHandleName               20
  18760.                 EMS_Move                        24
  18761.                 EMS_Exchange                    24
  18762.  
  18763.  
  18764.  
  18765.                     SCL1 Version 3.1 - Reference Manual - Page 306
  18766.  
  18767.  
  18768.  
  18769.  
  18770.  
  18771.  
  18772.  
  18773.                             Appendix "H" - Keyboard Macros
  18774.  
  18775.         A macro is series of keystrokes stored in memory or in a disk file
  18776.         that, when recalled, will perform as if they were keyed in into the
  18777.         keyboard. The number of macros that can be defined at once is limited
  18778.         only by the available memory. Macros can be of up to 32,000 keystrokes
  18779.         in size. The macro capability is available on any function that uses
  18780.         SCL1's keyboard handling functions, they will not be available if you
  18781.         call any of the standard library keyboard functions.
  18782.  
  18783.         If you do not use these macro capabilities, the keyboard related
  18784.         functions will work exactly as in previous versions of SCL1. When you
  18785.         invoke any of the macro related function, the keyboard functions will
  18786.         check to see if any defined macro or trap keyboard combination has
  18787.         been entered and when detected act on them.
  18788.  
  18789.         Macros are stored in a structure type MACROData defined in SCL1.H as
  18790.         follows:
  18791.  
  18792.                 typedef struct{
  18793.                     unsigned int key;
  18794.                     unsigned int size;
  18795.                     unsigned int *buffer;
  18796.                 }MACROData;
  18797.  
  18798.             where,
  18799.  
  18800.                 key is the key to trigger or invoke the macro.
  18801.  
  18802.                 size is the maximum number of keys to accept for the macro.
  18803.  
  18804.                 buffer is a pointer to the buffer that will hold the macro.
  18805.  
  18806.         Every macro defined will occupy one array member of this type. All
  18807.         macro related functions will read and/or write to this structure.
  18808.  
  18809.         The simplest way to use the macros is by using the MCR_Init function.
  18810.         This function will do almost everything for you. Every time the key
  18811.         defined for starting and stopping the macro recording process is
  18812.         pressed this function will send messages to your own user defined
  18813.         macro handling function. With these messages you can control the flow
  18814.         of the macro recording and storing. Once a macro is recorded it will
  18815.         immediately become available. You can save to disk the recorded macros
  18816.         using MCR_SaveMacro and you can retrieve macros using MCR_ReadFile,
  18817.         see MCR_Init for an example.Other functions permit more control of the
  18818.         macro creation and use process.
  18819.  
  18820.  
  18821.  
  18822.  
  18823.  
  18824.  
  18825.  
  18826.                     SCL1 Version 3.1 - Reference Manual - Page 307
  18827.  
  18828.  
  18829.  
  18830.  
  18831.  
  18832.  
  18833.  
  18834.                         Appendix "I" - Common Compiler Errors
  18835.  
  18836.         When compiling programs you may encounter several Compiler or Linker
  18837.         errors.  In this appendix the most common errors and some possible
  18838.         solutions are listed.
  18839.  
  18840.             Unresolved externals - You can get this message from the linker if
  18841.             one or more variables or functions specified in your source code
  18842.             is not found.  If it refers to an SCL1 function it means that you
  18843.             have not specified the SCL1 library module needed to properly link
  18844.             your program. See USING SCL1 for more information.
  18845.  
  18846.             Fix-up overflow - You can get this message if you compile your
  18847.             program using a memory model and then thy to link it with an SCL1
  18848.             library module of a different memory model. Memory models of must
  18849.             be the same.
  18850.  
  18851.             Code exceeds 64K - If you get this message while using the small
  18852.             or compact memory model it means that you must switch to the
  18853.             medium or large memory model.
  18854.  
  18855.             Stack & Data exceeds 64K - If you get this message while using the
  18856.             small or medium memory model it means you that you must switch to
  18857.             the compact or large memory model.  You can also get this message
  18858.             while using the compact or large memory model if your initialized
  18859.             static data cannot fit into the default data segment. Try removing
  18860.             some of this data by allocating and initializing buffers using
  18861.             malloc. If this is not possible you have several options depending
  18862.             on your compiler.  With Borland compilers switch to the huge
  18863.             memory model.  With the Microsoft compilers you can try declaring
  18864.             some of this data (big items) with the far keyword, this will
  18865.             force the compiler to move the data to a far data segment. You can
  18866.             also compile your source with the Gt switch. This switch tells the
  18867.             compiler to put large data items into far memory.
  18868.  
  18869.             Too many segments - The Microsoft linker has a default limit in
  18870.             the number of segments. You can increase this limit by adding the
  18871.             switch SE followed by the number of desired segments (for example,
  18872.             SE:256).
  18873.  
  18874.             undefined struct or constant - If it is an SCL1 related identifier
  18875.             you have to add the include directive with the proper SCL1's
  18876.             header file. See Appendix "D"
  18877.  
  18878.  
  18879.  
  18880.  
  18881.  
  18882.  
  18883.  
  18884.  
  18885.  
  18886.  
  18887.                     SCL1 Version 3.1 - Reference Manual - Page 308
  18888.  
  18889.  
  18890.  
  18891.  
  18892.  
  18893.  
  18894.  
  18895.                       Appendix "J" - Character Definition Tables
  18896.  
  18897.         In text modes, characters are defined in character definition tables.
  18898.         The following is a VGA character matrix defining character ASCII 1:
  18899.  
  18900.                           matrix         byte representation
  18901.  
  18902.                        0 0 0 0 0 0 0 0        0x00
  18903.                        0 0 0 0 0 0 0 0        0x00
  18904.                        0 1 1 1 1 1 1 0        0x7e
  18905.                        1 0 0 0 0 0 0 1        0x81
  18906.                        1 0 1 0 0 1 0 1        0xa5
  18907.                        1 0 0 0 0 0 0 1        0x81
  18908.                        1 0 0 0 0 0 0 1        0x81
  18909.                        1 0 1 1 1 1 0 1        0xbd
  18910.                        1 0 0 1 1 0 0 1        0x99
  18911.                        1 0 0 0 0 0 0 1        0x81
  18912.                        1 0 0 0 0 0 0 1        0x81
  18913.                        0 1 1 1 1 1 1 0        0x7e
  18914.                        0 0 0 0 0 0 0 0        0x00
  18915.                        0 0 0 0 0 0 0 0        0x00
  18916.                        0 0 0 0 0 0 0 0        0x00
  18917.                        0 0 0 0 0 0 0 0        0x00
  18918.  
  18919.         Each number represents one bit. Since each line has 8 bits it can be
  18920.         represented by one byte. A character definition matrix like this is
  18921.         normally represented by an array of 16 bytes starting with the top
  18922.         line (as seen at the right column). When displayed in the screen, bits
  18923.         set to "1" are displayed in the foreground color and bits set to "0"
  18924.         in the background color.
  18925.  
  18926.         EGA and VGA displays have several character tables used for several
  18927.         text modes:
  18928.  
  18929.             Video Mode 25x40    25x80    28x80  43x80     50x80
  18930.  
  18931.             VGA        8x16     8x16     8x14   N/A       8x8
  18932.             EGA        8x14     8x14     N/A    8x8       N/A
  18933.  
  18934.         In EGA and VGA monitors we can modify these tables to create new fonts
  18935.         and even display a graphic in a text screen mode (see BMPCNV.C
  18936.         included in the sample files). SCL1's ModifyCharSet function can be
  18937.         used to modify the character table that the BIOS is currently using.
  18938.         You have to be careful to pass the correct character matrix, so you
  18939.         need to check the type of monitor and the active video mode in order
  18940.         to know which character matrix to use. The easiest way to work with
  18941.         character definitions is to use SSG. Start SSG and modify any
  18942.         character using the SSG character editor (Video Menu, Modify Character
  18943.         Set) and then generate the source (Character Set object). When you
  18944.         save the file SSG will create a function that checks the monitor type
  18945.         and video mode to select the correct character matrix.
  18946.  
  18947.  
  18948.                     SCL1 Version 3.1 - Reference Manual - Page 309
  18949.  
  18950.  
  18951.  
  18952.  
  18953.  
  18954.  
  18955.  
  18956.                       Appendix "J" - Character Definition Tables
  18957.  
  18958.         Once a character has been modified it will be active until you change
  18959.         the video mode. SCL1's InitVideo function can be used to reset all
  18960.         characters to their default. You can also restore character
  18961.         definitions from a previously copied table in one of two ways.:
  18962.  
  18963.             1)  Using GetCharTable - This function copies one or more
  18964.                 characters from the active table to a buffer. Beware that this
  18965.                 characters are always in a 32 scanlines format used by the
  18966.                 BIOS when a character table is active. So when you call
  18967.                 ModifyCharSet to restore them you must specify that they have
  18968.                 32 scanlines.
  18969.  
  18970.             2)  Using GetCharTableAddress - This function returns a far
  18971.                 pointer to one of the BIOS character definition tables stored
  18972.                 in ROM. You must specify which character table you desire
  18973.                 using constant defined in SCL1.H (GCA_8X8A, GCA_8X8B,
  18974.                 GCA_8X14, GCA_8X16).  These character definitions cannot be
  18975.                 modified so they always have an original copy. Characters are
  18976.                 organized in these table in 8, 14 or 16 scanlines (the same
  18977.                 they are supposed to have).
  18978.  
  18979.         To create new character definition you can use the SSG character
  18980.         editor or draw a bitmap using Windows' PaintBrush program and using
  18981.         the BMPCNV conversion utility (included as C source file in the
  18982.         samples files) to create character definition out of the bitmap. In
  18983.         this case you must create a bitmap of a size in pixels that is a
  18984.         multiple of eight horizontally and 16, 14 or 8 vertically (depending
  18985.         of the target character matrix).
  18986.  
  18987.         Characters are displayed on the screen in 9 bits horizontal matrix.
  18988.         The extra bit is normally set to the background color to make sure
  18989.         that there is a separation between characters. In the case of ASCII
  18990.         codes 0xC0 to 0xDF (used for graphic characters) the righmost pixel is
  18991.         duplicated to make sure that characters are connected. If you want to
  18992.         duplicate a bitmap image you must use characters 0xC0-0xDF. As you see
  18993.         we're limited to the size of this bitmap. (You can also use BMPCNV to
  18994.         view bitmaps in text mode).
  18995.  
  18996.                                Modifying Palette Colors
  18997.  
  18998.         In text modes we have access to 16 different colors plus the border
  18999.         color. The value of these colors is set by the BIOS to defaults each
  19000.         time a video mode is set. Each color of this palette can have a value
  19001.         of 0-63, so although we can only have 16 colors at one time on the
  19002.         screen, we can select these 16 colors from a selection of 64 colors
  19003.         using SCL1's ModifyPalette (modify all palette colors and border
  19004.         color) or ModifyPaletteColor (modify one palette entry). Use SSG
  19005.         Palette editor (Video Menu, Modify Palette) or take a look at the
  19006.         SCL1DEMO Character and Palette under the Video Menu to see the
  19007.         different colors available.
  19008.  
  19009.                     SCL1 Version 3.1 - Reference Manual - Page 310
  19010.  
  19011.  
  19012.  
  19013.  
  19014.  
  19015.  
  19016.  
  19017.  
  19018.                                REGISTRATION INFORMATION
  19019.  
  19020.         SCL1 C function Library Version 3.1 is copyrighted by José Rodríguez
  19021.         Alvira & José R. Lebrón. You don't have to pay any royalties to use
  19022.         SCL1 in your programs. To Register as a SCL1 user and to obtain a copy
  19023.         of SCL1 libraries for the Small, Medium, Compact, Large and Huge
  19024.         memory models send $35.00 (or $70.00 to also get the source code) to:
  19025.  
  19026.                        José Rodríguez Alvira
  19027.                        El Monte Sur 190, Apt. B-342,
  19028.                        Hato Rey, Puerto Rico, 00918
  19029.  
  19030.         You will receive by mail the latest version of the SCL1 library for
  19031.         the compiler of your choice, and a free copy of a Full-Screen Extended
  19032.         ASCII Editor called SSG, that generates the source code of your
  19033.         screens using SCL1's functions (The SCL1DEMO was done with the help of
  19034.         SSG). You will be notified of any future additions or revisions to
  19035.         SCL1 and of any other program developed.
  19036.  
  19037.         You are encouraged to share the Demo Distribution disk with your
  19038.         friends. The full version that you obtain upon registration is not
  19039.         intended for free distribution and should not be shared with others.
  19040.  
  19041.         You can leave us a message through the Compuserve I.D. No. 70262,1562
  19042.         or BIX Name jalvira.
  19043.  
  19044.         The latest version of SCL1, sample programs and comments about these
  19045.         programs are available in:
  19046.  
  19047.                     TECH BBS (Sysop: José Romero)
  19048.                     (809)731-2322
  19049.  
  19050.         You do not have to be a registered member of this BBS to be able to
  19051.         download SCL1 files. If you call for the first time, after you answer
  19052.         the questionnaire you can locate SCL1 files in the FREE directory
  19053.         under the FILES menu.  Though new users have a 15 minutes per call
  19054.         time restrictions, the files located in this directory can be
  19055.         downloaded even if they take longer than 15 minutes to transfer.  In
  19056.         order to download more than one file use a batch type protocol.
  19057.  
  19058.         You can leave any comments, suggestions or questions in this BBS
  19059.         directed to JOSE ALVIRA or JOSE LEBRON. We will reply these messages
  19060.         in the same BBS.
  19061.  
  19062.         A german version of SCL1 is available from:
  19063.  
  19064.                     Michael Witte
  19065.                     Buchholzer Str. 8,
  19066.                     D-W-2116 Hanstedt
  19067.                     Germany
  19068.  
  19069.  
  19070.                     SCL1 Version 3.1 - Reference Manual - Page 311
  19071.  
  19072.  
  19073.  
  19074.  
  19075.  
  19076.  
  19077.  
  19078.                                         Index
  19079.  
  19080.           AddExtension  . . . . . . .  5     EMS_Move  . . . . . . . . . 43
  19081.           BackgroundOff . . . . . . .  6     EMS_PageAdress  . . . . . . 59
  19082.           BackgroundOn  . . . . . . .  9     EMS_Realloc . . . . . . . . 60
  19083.           Beep  . . . . . . . . . . .  9     EMS_RestorePageMap  . . . . 61
  19084.           BigCursor . . . . . . . . .  9     EMS_SavePageMap . . . . . . 62
  19085.           Bin2Ascii . . . . . . . . . 10     EMS_SetHandleName . . . . . 63
  19086.           Box . . . . . . . . . . . . 11     EMS_Status  . . . . . . . . 64
  19087.           Buf2Disk  . . . . . . . . . 13     EMS_TotalLogPages . . . . . 65
  19088.           C_SetUserLang . . . . . . . 30     EMS_Version . . . . . . . . 66
  19089.           Calendar  . . . . . . . . . 14     ErrorBox  . . . . . . . . . 67
  19090.           Center  . . . . . . . . . . 17     ErrorShadowOff  . . . . . . 68
  19091.           ChangeDumpColor . . . . . . 17     ErrorShadowOn . . . . . . . 68
  19092.           ChangeExtension . . . . . .  5     FB_SetUserLang  . . . . . . 69
  19093.           CheckChar . . . . . . . . . 18     FB3_SetUserLang . . . . . . 69
  19094.           CheckEnhancedKeyb . . . . . 19     FieldCheck  . . . . . . . . 70
  19095.           CheckItemList . . . . . . . 21     Fields  . . . . . . . . . . 71
  19096.           CheckMouse  . . . . . . . . 22     Fields2 . . . . . . . . . . 74
  19097.           CheckMouseButton  . . . . . 23     File2Buf  . . . . . . . . . 96
  19098.           ClearKeyBuf . . . . . . . . 24     FileBox . . . . . . . . . . 90
  19099.           ClearWindow . . . . . . . . 25     FileBox2  . . . . . . . . . 91
  19100.           ClockTick . . . . . . . . . 25     FileBox3  . . . . . . . . . 91
  19101.           CloseFile . . . . . . . . . 26     FillBlock . . . . . . . . . 97
  19102.           Cls . . . . . . . . . . . . 27     FindFirst . . . . . . . . . 98
  19103.           CreateFile  . . . . . . . . 28     FindNext  . . . . . . . . . 98
  19104.           CreateWindow  . . . . . . . 29     GetCharSet  . . . . . . .  101
  19105.           CursorOff . . . . . . . . . 29     GetCharSetAddress . . . .  101
  19106.           CursorOn  . . . . . . . . . 29     GetCurCol . . . . . . . .  102
  19107.           Date2Num  . . . . . . . . . 31     GetCurLine  . . . . . . .  102
  19108.           DaysPerMonth  . . . . . . . 32     GetCurrentDir . . . . . .  102
  19109.           DeleteFile  . . . . . . . . 32     GetCurSize  . . . . . . .  103
  19110.           DestroyWindow . . . . . . . 29     GetDate . . . . . . . . .  104
  19111.           DialogBox . . . . . . . . . 33     GetDefaultDrive . . . . .  105
  19112.           DisableMouse  . . . . . . . 34     GetDiskFreeSpace  . . . .  105
  19113.           Dissolve  . . . . . . . . . 34     GetExtendedAscii  . . . .  106
  19114.           DrawBoxLine . . . . . . . . 36     GetFileMode . . . . . . .  108
  19115.           DrawItemList  . . . . . . . 37     GetFilePt . . . . . . . .  109
  19116.           DrawLine  . . . . . . . . . 38     GetFiles  . . . . . . . .  107
  19117.           DrawMouseButton . . . . . . 39     GetFileSize . . . . . . .  111
  19118.           EB_SetUserLang  . . . . . . 40     GetFreeMem  . . . . . . .  111
  19119.           EMS_Alloc . . . . . . . . . 41     GetKey  . . . . . . . . .  112
  19120.           EMS_AvailableLogPages . . . 42     GetString . . . . . . . .  114
  19121.           EMS_Exchange  . . . . . . . 43     GetTime . . . . . . . . .  115
  19122.           EMS_Free  . . . . . . . . . 46     GSSBox  . . . . . . . . . . 11
  19123.           EMS_GetAllHandlePages . . . 47     HBuf2Disk . . . . . . . . . 13
  19124.           EMS_GetHandleCount  . . . . 48     HFile2Buf . . . . . . . . . 96
  19125.           EMS_GetHandleName . . . . . 49     HideMouse . . . . . . . .  116
  19126.           EMS_GetHandlePages  . . . . 50     Huge2Far  . . . . . . . .  115
  19127.           EMS_Init  . . . . . . . . . 51     I24_SetUserLang . . . . .  123
  19128.           EMS_Map . . . . . . . . . . 57     InitDrive . . . . . . . .  117
  19129.           EMS_MapMultipleEMS  . . . . 58     InitMouse . . . . . . . .  117
  19130.  
  19131.                     SCL1 Version 3.1 - Reference Manual - Page 312
  19132.  
  19133.  
  19134.  
  19135.  
  19136.  
  19137.  
  19138.  
  19139.                                         Index
  19140.  
  19141.           InitUserError . . . . . .  118     PopMenu . . . . . . . . .  196
  19142.           InitVideo . . . . . . . .  118     PushCursor  . . . . . . .  194
  19143.           InitWData . . . . . . . .  119     ReadFile  . . . . . . . .  197
  19144.           Int24ShadowOff  . . . . .  122     ReadPalette . . . . . . .  198
  19145.           Int24ShadowOn . . . . . .  122     RecordFile  . . . . . . .  198
  19146.           KeyReady  . . . . . . . .  124     RemoveDir . . . . . . . .  202
  19147.           KeyStatus . . . . . . . .  125     RemoveExtension . . . . .  202
  19148.           LeapYear  . . . . . . . .  127     RenameFile  . . . . . . .  203
  19149.           LineEditor  . . . . . . .  128     ResetMouse  . . . . . . .  204
  19150.           LinkedList  . . . . . . .  136     ResetMouseCur . . . . . .  204
  19151.           ListManager . . . . . . .  140     RestoreInt10  . . . . . .  248
  19152.           ListWindow  . . . . . . .  142     ScreenDump  . . . . . . .  205
  19153.           LW_MoveTo . . . . . . . .  147     ScrollDown  . . . . . . .  206
  19154.           MakeDir . . . . . . . . .  160     ScrollList  . . . . . . .  207
  19155.           MCR_CloseFile . . . . . .  148     ScrollUp  . . . . . . . .  206
  19156.           MCR_Init  . . . . . . . .  148     ScrollWindow  . . . . . .  208
  19157.           MCR_MacroDisable  . . . .  153     Select  . . . . . . . . .  214
  19158.           MCR_MacroEnable . . . . .  153     SetBin2AsciiDel . . . . .  217
  19159.           MCR_MacroExist  . . . . .  153     SetCurPos . . . . . . . .  218
  19160.           MCR_Play  . . . . . . . .  154     SetCurSize  . . . . . . .  218
  19161.           MCR_ReadFile  . . . . . .  154     SetDialogColor  . . . . .  219
  19162.           MCR_Record  . . . . . . .  155     SetErrorBoxColor  . . . .  219
  19163.           MCR_RegisterBackF . . . .  155     SetFileMode . . . . . . .  220
  19164.           MCR_RegisterMacro . . . .  156     SetHorLimit . . . . . . .  221
  19165.           MCR_RegisterTrapKey . . .  157     SetInt24Colors  . . . . .  222
  19166.           MCR_Report  . . . . . . .  157     SetMouseCur . . . . . . .  222
  19167.           MCR_SaveMacro . . . . . .  158     SetMouseIsr . . . . . . .  222
  19168.           MCR_UnregisterBackF . . .  159     SetMousePos . . . . . . .  224
  19169.           MCR_UnregisterMacro . . .  159     SetShadowColor  . . . . .  225
  19170.           MCR_UnregisterTrapKey . .  159     SetUserBox  . . . . . . .  225
  19171.           Menu  . . . . . . . . . .  161     SetUserBoxLine  . . . . .  226
  19172.           MenuSystem  . . . . . . .  164     SetVerLimit . . . . . . .  221
  19173.           MenuSystem2 . . . . . . .  164     SetVideo25  . . . . . . .  229
  19174.           MESS_SetPosition  . . . .  178     SetVideo28  . . . . . . .  229
  19175.           MessageOff  . . . . . . .  179     SetVideo4350  . . . . . .  229
  19176.           MessageOn . . . . . . . .  180     SetVideoMode  . . . . . .  227
  19177.           MessageShadowOff  . . . .  180     SetVideoPage  . . . . . .  228
  19178.           MessageShadowOn . . . . .  180     Shadow  . . . . . . . . .  230
  19179.           ModifyCharSet . . . . . .  182     ShellSort . . . . . . . .  231
  19180.           ModifyPalette . . . . . .  184     ShowMouse . . . . . . . .  116
  19181.           ModifyPaletteColor  . . .  185     SortPointers  . . . . . .  233
  19182.           MouseButton . . . . . . .  187     Sound . . . . . . . . . .  234
  19183.           MouseMenu . . . . . . . .  161     SoundOff  . . . . . . . .  234
  19184.           MouseMenu2  . . . . . . .  161     SoundOn . . . . . . . . .  234
  19185.           MoveFilePt  . . . . . . .  189     StopWatch . . . . . . . .  235
  19186.           MoveFilePt2Offset . . . .  190     SW_MoveTo . . . . . . . .  147
  19187.           Num2Date  . . . . . . . .  190     TagItem . . . . . . . . .  236
  19188.           OpenFile  . . . . . . . .  191     TagList . . . . . . . . .  238
  19189.           PercentBar  . . . . . . .  193     TagList2  . . . . . . . .  240
  19190.           PopCursor . . . . . . . .  194     TagMenu . . . . . . . . .  242
  19191.  
  19192.                     SCL1 Version 3.1 - Reference Manual - Page 313
  19193.  
  19194.  
  19195.  
  19196.  
  19197.  
  19198.  
  19199.  
  19200.                                         Index
  19201.  
  19202.           TextWindow  . . . . . . .  245     ZWindow287
  19203.           TL_SetUserLang  . . . . .  248
  19204.           TrapBIOSScreenWrite . . .  248
  19205.           TrapInt10 . . . . . . . .  248
  19206.           TrapInt23 . . . . . . . .  249
  19207.           TrapInt24 . . . . . . . .  250
  19208.           TSound  . . . . . . . . .  251
  19209.           Video . . . . . . . . . .  251
  19210.           VideoConfig . . . . . . .  252
  19211.           WaitKeyMouse  . . . . . .  254
  19212.           WaitTime  . . . . . . . .  254
  19213.           WF_SetUserLang  . . . . . . 69
  19214.           WFileBox  . . . . . . . . . 91
  19215.           Window  . . . . . . . . .  254
  19216.           WriteChar . . . . . . . .  256
  19217.           WriteFile . . . . . . . .  257
  19218.           WriteOffLen . . . . . . .  257
  19219.           WriteOffset . . . . . . .  258
  19220.           WriteScreen . . . . . . .  259
  19221.           WriteScreenC  . . . . . .  259
  19222.           WriteScreenCLen . . . . .  260
  19223.           WriteScreenLen  . . . . .  260
  19224.           WriteScreenR  . . . . . .  259
  19225.           WriteScreenRLen . . . . .  260
  19226.           WriteWindow . . . . . . .  262
  19227.           XMS_AllocExtended . . . .  263
  19228.           XMS_FreeExtended  . . . .  264
  19229.           XMS_GetEMBHandleInfo  . .  265
  19230.           XMS_GetVersion  . . . . .  266
  19231.           XMS_GlobalDisableA20  . .  267
  19232.           XMS_GlobalEnableA20 . . .  267
  19233.           XMS_Init  . . . . . . . .  268
  19234.           XMS_LocalDisableA20 . . .  275
  19235.           XMS_LocalEnableA20  . . .  275
  19236.           XMS_LockExtended  . . . .  276
  19237.           XMS_MoveExtended  . . . .  277
  19238.           XMS_QueryA20  . . . . . .  278
  19239.           XMS_QueryFreeExtended . .  279
  19240.           XMS_ReallocExtended . . .  279
  19241.           XMS_ReleaseHMA  . . . . .  280
  19242.           XMS_ReleaseUMB  . . . . .  281
  19243.           XMS_RequestHMA  . . . . .  280
  19244.           XMS_RequestUMB  . . . . .  281
  19245.           XMS_UnlockExtended  . . .  282
  19246.           YesNo . . . . . . . . . .  283
  19247.           YesNoShadowOff  . . . . .  284
  19248.           YesNoShadowOn . . . . . .  284
  19249.           YN_SetFrame . . . . . . .  286
  19250.           YN_SetUserLang  . . . . .  285
  19251.           YNSetPosition . . . . . .  284
  19252.  
  19253.                     SCL1 Version 3.1 - Reference Manual - Page 314
  19254.